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

DataFrame.DecisionTree.Cart

Description

sklearn-faithful CART initializer used to seed TAO. One-hot encodes categoricals and splits on exact (unsmoothed) Gini over midpoint thresholds (<= routes left), matching DecisionTreeClassifier(criterion=gini).

Synopsis

Documentation

data CartFeature Source #

A one-hot feature column: per-row Double values plus the sklearn LEFT predicate (x <= threshold) over the ORIGINAL DataFrame.

Constructors

CartFeature 

Fields

data CartNode Source #

Pre-Tree CART node: a leaf class id, or a split on feature j.

Constructors

CLeaf !Int 
CSplit !Int !Double !CartNode !CartNode 

sortIndicesByValue :: Vector Double -> Vector Int Source #

Indices 0..n-1 stably sorted by their value (ascending), ties keeping ascending index. In-place unboxed merge sort — no boxed-list allocation.

cartFeatures :: Text -> DataFrame -> [CartFeature] Source #

One-hot features in pd.get_dummies(drop_first=False) column order.

cartTargetLabels :: Text -> DataFrame -> Vector Text Source #

Target column as string labels (matches pandas y.astype(str)).