chainladder.DevelopmentML#
- class chainladder.DevelopmentML(estimator_ml=None, y_ml=None, autoregressive=False, weight_ml=None, fit_incrementals=True)#
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.New 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.
- 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.
Methods
fit
(X[, y, sample_weight])Fit the model with X.
fit_transform
(X[, y])Fit to data, then transform it.
get_metadata_routing
()Get metadata routing of this object.
get_params
([deep])Get parameters for this estimator.
set_backend
(backend[, inplace, deep])Converts triangle array_backend.
set_fit_request
(*[, sample_weight])Request metadata passed to the
fit
method.set_output
(*[, transform])Set output container.
set_params
(**params)Set the parameters of this estimator.
to_json
()Serializes triangle object to json format
to_pickle
(path[, protocol])Serializes triangle object to pickle.
transform
(X)If X and self are of different shapes, align self to X, else return self.
pipe