| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
DataFrame.Internal.AggPlan
Description
The aggregation fast-path planner and the two-column moment scatter.
planAgg recognises a supported aggregate shape over a clean unboxed Int/Double
column and returns an AggPlan; momentScatter fuses the six regression sums.
Synopsis
- data AggPlan
- planAgg :: GroupedDataFrame -> UExpr -> Maybe AggPlan
- data Moments = Moments {}
- momentScatter :: Vector Int -> Int -> Column -> Column -> Maybe Moments
- data MomentPlan = MomentPlan {}
- planMoments :: GroupedDataFrame -> [(Text, UExpr)] -> Maybe MomentPlan
Documentation
The plan planAgg produces for a recognised output expression. The median
plan carries only the column name (the holistic grouped sort lives in the
operations layer, where vector-algorithms is available).
Constructors
| PlanScatter Reduction Text | A single scatter reduction over one named column. |
| PlanMaxMinusMin Text Text |
|
| PlanMedian Text | Holistic median over one named column. |
planAgg :: GroupedDataFrame -> UExpr -> Maybe AggPlan Source #
Inspect a named output expression; return Just plan on a recognised shape
over a present clean column, else Nothing. Nullable or non-Int/Double columns
are rejected here so the scatter only sees a clean unboxed vector.
The additive moment sums of two columns, each an nGroups-length column:
(n, Sx, Sy, Sxx, Syy, Sxy).
momentScatter :: Vector Int -> Int -> Column -> Column -> Maybe Moments Source #
One pass over two Double-coercible columns x and y filling the count and
five sums, collapsing the Q9 regression family's six folds into a single pass.
Nothing unless both columns are non-null unboxed Int/Double.
data MomentPlan Source #
A recognised moment (Q9 regression) aggregate group: six output columns that
form the sufficient statistics of two base columns x and y. The caller runs
momentScatter once and binds each output name to a field of the result.
planMoments :: GroupedDataFrame -> [(Text, UExpr)] -> Maybe MomentPlan Source #
Recognise the moment shape across a whole aggregate list: exactly
count, sum(x), sum(y), sum(x*x), sum(y*y), sum(x*y) over two distinct
clean unboxed base columns. Nothing on any other set.