| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
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+bandb+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
- module DataFrame.Model
- data LossFunction
- data SynthesisConfig = SynthesisConfig {
- synMaxSize :: !Int
- synBankCap :: !Int
- synLoss :: !LossFunction
- synTopK :: !Int
- synMaxAllocBytes :: !Int
- defaultSynthesisConfig :: SynthesisConfig
- data SynthesizedFeature = SynthesizedFeature {}
- synthesizeFeatures :: SynthesisConfig -> Expr Double -> DataFrame -> SynthesizedFeature
Documentation
module DataFrame.Model
data LossFunction Source #
How a candidate's output column is scored against the target (higher is better).
Constructors
| PearsonCorrelation | Pearson |
| MutualInformation | Binned mutual information: captures nonlinear association. |
| MeanSquaredError | Negative mean squared error: for reproducing a target exactly. |
Instances
| Show LossFunction Source # | |
Defined in DataFrame.Synthesis Methods showsPrec :: Int -> LossFunction -> ShowS # show :: LossFunction -> String # showList :: [LossFunction] -> ShowS # | |
| Eq LossFunction Source # | |
Defined in DataFrame.Synthesis | |
data SynthesisConfig Source #
Search hyperparameters.
Constructors
| SynthesisConfig | |
Fields
| |
Instances
| Show SynthesisConfig Source # | |||||||||
Defined in DataFrame.Synthesis Methods showsPrec :: Int -> SynthesisConfig -> ShowS # show :: SynthesisConfig -> String # showList :: [SynthesisConfig] -> ShowS # | |||||||||
| Eq SynthesisConfig Source # | |||||||||
Defined in DataFrame.Synthesis Methods (==) :: SynthesisConfig -> SynthesisConfig -> Bool # (/=) :: SynthesisConfig -> SynthesisConfig -> Bool # | |||||||||
| Fit SynthesisConfig (Expr Double) Source # | |||||||||
Defined in DataFrame.Synthesis Associated Types
| |||||||||
| type FrameReq SynthesisConfig (Expr Double) Source # | |||||||||
Defined in DataFrame.Synthesis | |||||||||
| type ModelOf SynthesisConfig (Expr Double) Source # | |||||||||
Defined in DataFrame.Synthesis | |||||||||
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 | |
Instances
| Predict SynthesizedFeature Source # | |||||
Defined in DataFrame.Synthesis Associated Types
Methods predict :: SynthesizedFeature -> Prediction SynthesizedFeature Source # | |||||
| type Prediction SynthesizedFeature Source # | |||||
Defined in DataFrame.Synthesis | |||||
synthesizeFeatures :: SynthesisConfig -> Expr Double -> DataFrame -> SynthesizedFeature Source #
Search for expressions over the non-target columns that track target.