base¶
Classes
BaseChangePointsModelAdapter is the base class for change point models adapters. |
- class BaseChangePointsModelAdapter[source]¶
BaseChangePointsModelAdapter is the base class for change point models adapters.
- abstract get_change_points(df: pandas.core.frame.DataFrame, in_column: str) List[pandas._libs.tslibs.timestamps.Timestamp] [source]¶
Find change points within one segment.
- Parameters
df (pandas.core.frame.DataFrame) – dataframe indexed with timestamp
in_column (str) – name of column to get change points
- Returns
change point timestamps
- Return type
change points
- get_change_points_intervals(df: pandas.core.frame.DataFrame, in_column: str) List[Tuple[pandas._libs.tslibs.timestamps.Timestamp, pandas._libs.tslibs.timestamps.Timestamp]] [source]¶
Find change point intervals in given dataframe and column.
- Parameters
df (pandas.core.frame.DataFrame) – dataframe indexed with timestamp
in_column (str) – name of column to get change points
- Returns
change points intervals
- Return type
List[Tuple[pandas._libs.tslibs.timestamps.Timestamp, pandas._libs.tslibs.timestamps.Timestamp]]
- set_params(**params: dict) etna.core.mixins.TMixin ¶
Return new object instance with modified parameters.
Method also allows to change parameters of nested objects within the current object. For example, it is possible to change parameters of a
model
in aPipeline
.Nested parameters are expected to be in a
<component_1>.<...>.<parameter>
form, where components are separated by a dot.- Parameters
**params – Estimator parameters
self (etna.core.mixins.TMixin) –
params (dict) –
- Returns
New instance with changed parameters
- Return type
etna.core.mixins.TMixin
Examples
>>> from etna.pipeline import Pipeline >>> from etna.models import NaiveModel >>> from etna.transforms import AddConstTransform >>> model = model=NaiveModel(lag=1) >>> transforms = [AddConstTransform(in_column="target", value=1)] >>> pipeline = Pipeline(model, transforms=transforms, horizon=3) >>> pipeline.set_params(**{"model.lag": 3, "transforms.0.value": 2}) Pipeline(model = NaiveModel(lag = 3, ), transforms = [AddConstTransform(in_column = 'target', value = 2, inplace = True, out_column = None, )], horizon = 3, )
- to_dict()¶
Collect all information about etna object in dict.