PerSegmentModelMixin

class PerSegmentModelMixin(base_model: Any)[source]

Bases: etna.models.mixins.ModelForecastingMixin

Mixin for holding methods for per-segment prediction.

Init PerSegmentModelMixin.

Parameters

base_model (Any) – Internal model which will be used to forecast segments, expected to have fit/predict interface

Inherited-members

Methods

fit(ts)

Fit model.

get_model()

Get internal models that are used inside etna class.

fit(ts: etna.datasets.tsdataset.TSDataset) etna.models.mixins.PerSegmentModelMixin[source]

Fit model.

Parameters

ts (etna.datasets.tsdataset.TSDataset) – Dataset with features

Returns

Model after fit

Return type

etna.models.mixins.PerSegmentModelMixin

get_model() Dict[str, Any][source]

Get internal models that are used inside etna class.

Internal model is a model that is used inside etna to forecast segments, e.g. catboost.CatBoostRegressor or sklearn.linear_model.Ridge.

Returns

dictionary where key is segment and value is internal model

Return type

Dict[str, Any]