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 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
- 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
orsklearn.linear_model.Ridge
.- Returns
dictionary where key is segment and value is internal model
- Return type
Dict[str, Any]