SpecialDaysTransform¶
- class SpecialDaysTransform(find_special_weekday: bool = True, find_special_month_day: bool = True)[source]¶
Bases:
etna.transforms.base.IrreversiblePerSegmentWrapper
,etna.transforms.base.FutureMixin
SpecialDaysTransform generates series that indicates is weekday/monthday is special in given dataframe.
Creates columns ‘anomaly_weekdays’ and ‘anomaly_monthdays’.
Warning
This transform can suffer from look-ahead bias. For transforming data at some timestamp it uses information from the whole train part.
Create instance of SpecialDaysTransform.
- Parameters
find_special_weekday (bool) – flag, if True, find special weekdays in transform
find_special_month_day (bool) – flag, if True, find special monthdays in transform
- Raises
ValueError: – if all the modes are False
- Inherited-members
Methods
fit
(ts)Fit the transform.
fit_transform
(ts)Fit and transform TSDataset.
Return the list with regressors created by the transform.
inverse_transform
(ts)Inverse transform TSDataset.
load
(path)Load an object.
Get default grid for tuning hyperparameters.
save
(path)Save the object.
set_params
(**params)Return new object instance with modified parameters.
to_dict
()Collect all information about etna object in dict.
transform
(ts)Transform TSDataset inplace.
- get_regressors_info() List[str] [source]¶
Return the list with regressors created by the transform.
- Return type
List[str]
- params_to_tune() Dict[str, etna.distributions.distributions.BaseDistribution] [source]¶
Get default grid for tuning hyperparameters.
This grid tunes parameters:
find_special_weekday
,find_special_month_day
. Other parameters are expected to be set by the user.There are no restrictions on all
False
values for the flags.- Returns
Grid to tune.
- Return type
Dict[str, etna.distributions.distributions.BaseDistribution]