-
Notifications
You must be signed in to change notification settings - Fork 891
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR adds the following new groupby aggregations: * `M2`: sum of squares of differences from group mean, which is essentially an unscaled version of variance * `MERGE_M2` for merging distributedly computed `M2` These are auxiliary aggregations used for generating intermediate results for distributed computing of variance and standard deviation, with numerical stability. Below is an overview of the algorithm for distributed computing of `VARIANCE` aggregation: * Partition data into batches and compute (partial results) groupby `COUNT_VALID`, `MEAN` and `M2` aggregations for each batch. * Vertically concatenate results of `COUNT_VALID`, `MEAN` and `M2`, then assemble a structs column with these values in separate children columns. * The new structs column is given as the input values column to `MERGE_M2` aggregation to produce new merged values for those partial results, following the algorithm described here: https://www.wikiwand.com/en/Algorithms_for_calculating_variance#/Parallel_algorithm. As such, the output of `MERGE_M2` is also a structs column similar to its input. * Those partial results (`COUNT_VALID`, `MEAN`, and `M2`) may be merged in several merging steps. * After the last merging step, we have the final `M2` values. Then, a finalizing step will compute variance/std for each key group using cudf binops (`variance = M2 / group_size`, and ``variance_pop = M2 / (group_size - 1)`). Reference: https://www.wikiwand.com/en/Algorithms_for_calculating_variance#/Parallel_algorithm There are also some other clean-up and re-order code in several related files. Authors: - Nghia Truong (https://github.com/ttnghia) Approvers: - Jake Hemstad (https://github.com/jrhemstad) - Vukasin Milovanovic (https://github.com/vuule) URL: #8605
- Loading branch information
Showing
11 changed files
with
1,439 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.