PatsyFormula#

class chainladder.PatsyFormula(formula=None)[source]#

A sklearn-style Transformer for patsy formulas.

PatsyFormula allows for R-style formula preprocessing of the design_matrix of a machine learning algorithm. It’s particularly useful with the DevelopmentML and TweedieGLM estimators.

Parameters:
formula: str

A string representation of the regression model X features.

Attributes:
design_info_:

The patsy instructions for generating the design_matrix, X.

fit(X, y=None, sample_weight=None)[source]#
transform(X)[source]#

Inherited Methods

PatsyFormula.fit_transform

Fit to data, then transform it.

PatsyFormula.get_metadata_routing

Get metadata routing of this object.

PatsyFormula.get_params

Get parameters for this estimator.

PatsyFormula.set_output

Set output container.

PatsyFormula.set_params

Set the parameters of this estimator.