dataframe-learn-2.4.1.0: Interpretable, expression-returning machine learning for the dataframe ecosystem.
Safe HaskellNone
LanguageHaskell2010

DataFrame.Synthesis

Description

Feature synthesis by bottom-up enumerative search with observational equivalence — the canonical enumerative method from Solar-Lezama's Introduction to Program Synthesis.

Given a frame and a numeric target column, it searches for a small, interpretable arithmetic expression over the other columns whose values track the target.

The engine:

  • enumerates programs by increasing AST size (so the first representative of any behaviour is the smallest — interpretability for free);
  • evaluates each candidate incrementally by combining the cached result vectors of its subprograms (one vector op), never re-interpreting the whole tree;
  • keeps exactly one program per observational-equivalence class — candidates producing the same column (up to a float tolerance) are interchangeable, so duplicates are dropped rather than re-explored;
  • breaks commutative symmetry (never both a+b and b+a) and uses protected operators (sqrt|x|, log(|x|+1)) plus a denominator guard so domain errors never arise;
  • caps each size layer by fit score when it grows large (a cost-guided tractability bound over distinct behaviours, not a lossy beam over raw syntax).

fit returns the best SynthesizedFeature; predict is its expression. synthesizeFeatures returns the whole ranked, deduplicated feature bank — useful as automated feature engineering feeding a downstream model.

Deferred (documented next steps, not yet implemented): skeleton enumeration with closed-form least-squares coefficient fitting, hard-row counterexample sampling for very large frames, and piecewise (condition-abduction) features.

Synopsis

Documentation

data LossFunction Source #

How a candidate's output column is scored against the target (higher is better).

Constructors

PearsonCorrelation

Pearson r²: scale-invariant, the default for derived features.

MutualInformation

Binned mutual information: captures nonlinear association.

MeanSquaredError

Negative mean squared error: for reproducing a target exactly.

Instances

Instances details
Show LossFunction Source # 
Instance details

Defined in DataFrame.Synthesis

Eq LossFunction Source # 
Instance details

Defined in DataFrame.Synthesis

data SynthesisConfig Source #

Search hyperparameters.

Constructors

SynthesisConfig 

Fields

data SynthesizedFeature Source #

A synthesized feature. sfExpr is the best-scoring expression and sfFeatures is the ranked, observationally-distinct bank (expression and its score).

Constructors

SynthesizedFeature 

Fields

synthesizeFeatures :: SynthesisConfig -> Expr Double -> DataFrame -> SynthesizedFeature Source #

Search for expressions over the non-target columns that track target.