chainladder.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.
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])Configure whether metadata should be requested to be passed to the
fitmethod.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