DevelopmentML#

class chainladder.DevelopmentML(estimator_ml=None, y_ml=None, autoregressive=False, weighted_step=None, drop=None, drop_valuation=None, fit_incrementals=True)[source]#

A Estimator that interfaces with machine learning (ML) tools that implement the scikit-learn API.

The DevelopmentML estimator is used to generate ldf_ patterns from the data.

Added in version 0.8.1.

Parameters:
estimator_ml: skearn Estimator

Any sklearn compatible regression estimator, including Pipelines and

y_ml: list or str or sklearn_transformer

The response column(s) for the machine learning algorithm. It must be present within the Triangle.

autoregressive: tuple, (autoregressive_col_name, lag, source_col_name)

The subset of response column(s) to use as lagged features for the Time Series aspects of the model. Predictions from one development period get used as featues in the next development period. Lags should be negative integers.

weight_step: str

Step name within estimator_ml that is weighted

drop: tuple or list of tuples

Drops specific origin/development combination(s)

drop_valuation: str or list of str (default = None)

Drops specific valuation periods. str must be date convertible.

fit_incrementals:

Whether the response variable should be converted to an incremental basis for fitting.

Attributes:
estimator_ml: Estimator

An sklearn-style estimator to predict development patterns

ldf_: Triangle

The estimated loss development patterns.

cdf_: Triangle

The estimated cumulative development patterns.

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

Fit the model with X.

Parameters:
XTriangle-like

Set of LDFs to which the estimator will be applied.

yNone

Ignored, use y_ml to set a reponse variable for the ML algorithm

sample_weightTriangle-like

Weights to use in the regression

Returns:
selfobject

Returns the instance itself.

transform(X)[source]#

If X and self are of different shapes, align self to X, else return self.

Parameters:
XTriangle

The triangle to be transformed

Returns:
X_newNew triangle with transformed attributes.

Inherited Methods

DevelopmentML.fit_transform

Fit to data, then transform it.

DevelopmentML.get_metadata_routing

Get metadata routing of this object.

DevelopmentML.get_params

Get parameters for this estimator.

DevelopmentML.pipe

DevelopmentML.set_backend

Converts triangle array_backend.

DevelopmentML.set_output

Set output container.

DevelopmentML.set_params

Set the parameters of this estimator.

DevelopmentML.to_json

Serializes triangle object to json format

DevelopmentML.to_pickle

Serializes triangle object to pickle.