Visitar URL original
DataFrame.Segmented
dataframe-learn-2.5.0.1: Interpretable, expression-returning machine learning for the dataframe ecosystem.
Safe HaskellNone
LanguageHaskell2010

DataFrame.Segmented

Description

Fit a separate base model per categorical value-combination.

Synopsis

Documentation

data Segmented cfg Source #

A base estimator wrapped to fit one model per categorical combination.

Constructors

Segmented 

Fields

Instances

Instances details
Show cfg => Show (Segmented cfg) Source # 
Instance details

Defined in DataFrame.Segmented

Methods

showsPrec :: Int -> Segmented cfg -> ShowS #

show :: Segmented cfg -> String #

showList :: [Segmented cfg] -> ShowS #

Eq cfg => Eq (Segmented cfg) Source # 
Instance details

Defined in DataFrame.Segmented

Methods

(==) :: Segmented cfg -> Segmented cfg -> Bool #

(/=) :: Segmented cfg -> Segmented cfg -> Bool #

(Fit cfg (Expr a), SegmentFit cfg a, Predict (ModelOf cfg (Expr a)), Prediction (ModelOf cfg (Expr a)) ~ Expr a, Columnable a) => Fit (Segmented cfg) (Expr a) Source # 
Instance details

Defined in DataFrame.Segmented

Associated Types

type ModelOf (Segmented cfg) (Expr a) 
Instance details

Defined in DataFrame.Segmented

type ModelOf (Segmented cfg) (Expr a) = SegmentedModel a (ModelOf cfg (Expr a))
type FrameReq (Segmented cfg) (Expr a) 
Instance details

Defined in DataFrame.Segmented

type FrameReq (Segmented cfg) (Expr a) = 'AnyFrame

Methods

fit :: Segmented cfg -> Expr a -> FrameFor (Expr a) -> FitResult (FrameFor (Expr a)) (ModelOf (Segmented cfg) (Expr a)) Source #

type FrameReq (Segmented cfg) (Expr a) Source # 
Instance details

Defined in DataFrame.Segmented

type FrameReq (Segmented cfg) (Expr a) = 'AnyFrame
type ModelOf (Segmented cfg) (Expr a) Source # 
Instance details

Defined in DataFrame.Segmented

type ModelOf (Segmented cfg) (Expr a) = SegmentedModel a (ModelOf cfg (Expr a))

segmented :: cfg -> Segmented cfg Source #

Wrap a base config with default segmentation settings.

segmentOn :: Segmented cfg -> [Text] -> Segmented cfg Source #

Segment only on the named Text columns, overriding auto-detect.

pooled :: Segmented cfg -> Double -> Segmented cfg Source #

Set the pooling strength λ (shrink segments toward the reference).

data Segment model Source #

One fitted segment: its categorical key, row count, and base model.

Constructors

Segment 

Fields

Instances

Instances details
Show model => Show (Segment model) Source # 
Instance details

Defined in DataFrame.Segmented

Methods

showsPrec :: Int -> Segment model -> ShowS #

show :: Segment model -> String #

showList :: [Segment model] -> ShowS #

data SegmentedModel a model Source #

A fitted segmented model with per-segment, fallback and routing parts.

Constructors

SegmentedModel 

Fields

Instances

Instances details
(Show model, Show a) => Show (SegmentedModel a model) Source # 
Instance details

Defined in DataFrame.Segmented

Methods

showsPrec :: Int -> SegmentedModel a model -> ShowS #

show :: SegmentedModel a model -> String #

showList :: [SegmentedModel a model] -> ShowS #

Predict (SegmentedModel a model) Source # 
Instance details

Defined in DataFrame.Segmented

Associated Types

type Prediction (SegmentedModel a model) 
Instance details

Defined in DataFrame.Segmented

type Prediction (SegmentedModel a model) = Expr a

Methods

predict :: SegmentedModel a model -> Prediction (SegmentedModel a model) Source #

type Prediction (SegmentedModel a model) Source # 
Instance details

Defined in DataFrame.Segmented

type Prediction (SegmentedModel a model) = Expr a

class Fit cfg (Expr a) => SegmentFit cfg a where Source #

How a base estimator fits per-segment models under pooling strength.

Minimal complete definition

Nothing

Methods

fitSegments :: cfg -> Double -> Expr a -> [DataFrame] -> [ModelOf cfg (Expr a)] Source #

Fit the qualifying segments (each a numeric-only frame, in order).

Instances

Instances details
(Columnable a, Ord a) => SegmentFit LogisticConfig a Source #

Logistic segments support independent fitting (lambda = 0) only, for now.

Instance details

Defined in DataFrame.Segmented

SegmentFit LinearConfig Double Source #

Linear segments with exact closed-form pooling.

Instance details

Defined in DataFrame.Segmented

SegmentFit SRConfig Double Source #

Symbolic-regression segments support independent fitting (lambda = 0) only.

Instance details

Defined in DataFrame.Segmented