vastorbit.VastFrame.aad¶
- VastFrame.aad(columns: Annotated[str | list[str], 'STRING representing one column or a list of columns'] | None = None, **agg_kwargs) TableSample¶
Utilizes the
aad(Average Absolute Deviation) aggregation method to analyze the VastColumn.AADmeasures the average absolute deviation of data points from their mean, offering valuable insights into data variability and dispersion. When we aggregate the VastFrame usingaad, we gain an understanding of how data points deviate from the mean on average, which is particularly useful for assessing data spread and the magnitude of deviations.This method is valuable in scenarios where we want to evaluate data variability while giving equal weight to all data points, regardless of their direction of deviation. Calculating
aadprovides us with information about the overall data consistency and can be useful in various analytical and quality assessment contexts.Warning
To compute aad, vastorbit needs to execute multiple queries. It necessitates, at a minimum, a query that includes a subquery to perform this type of aggregation. This complexity is the reason why calculating aad is typically slower than some other types of aggregations.
- Parameters:
columns (SQLColumns, optional) – List of the VastColumns names. If empty, all VastColumns are used.
**agg_kwargs – Any optional parameter to pass to the Aggregate function.
- Returns:
result.
- Return type:
Examples
For this example, we will use the following dataset:
import vastorbit as vo data = vo.VastFrame( { "x": [1, 2, 4, 9, 10, 15, 20, 22], "y": [1, 2, 1, 2, 1, 1, 2, 1], "z": [10, 12, 2, 1, 9, 8, 1, 3], } )
Now, let’s calculate the average absolute deviation for specific columns.
data.aad( columns = ["x", "y", "z"], )
aad "x" 6.46875 "y" 0.46875 "z" 4.0 Rows: 1-3 | Columns: 2Note
All the calculations are pushed to the database.
Hint
For more precise control, please refer to the
aggregatemethod.