_OneSegmentDeseasonalityTransform

class _OneSegmentDeseasonalityTransform(in_column: str, period: int, model: str = DeseasonalModel.additive)[source]

Bases: etna.transforms.base.OneSegmentTransform

Init _OneSegmentDeseasonalityTransform.

Parameters
  • in_column (str) – name of processed column

  • period (int) – size of seasonality

  • model (str) – ‘additive’ (default) or ‘multiplicative’

Inherited-members

Methods

fit(df)

Perform seasonal decomposition.

fit_transform(df)

Fit and transform Dataframe.

inverse_transform(df)

Add seasonal component.

set_params(**params)

Return new object instance with modified parameters.

to_dict()

Collect all information about etna object in dict.

transform(df)

Subtract seasonal component.

fit(df: pandas.core.frame.DataFrame) etna.transforms.decomposition.deseasonal._OneSegmentDeseasonalityTransform[source]

Perform seasonal decomposition.

Parameters

df (pandas.core.frame.DataFrame) – Features dataframe with time

Returns

instance after processing

Return type

result

Raises

ValueError: – if input column contains NaNs in the middle of the series

inverse_transform(df: pandas.core.frame.DataFrame) pandas.core.frame.DataFrame[source]

Add seasonal component.

Parameters

df (pandas.core.frame.DataFrame) – Features dataframe with time

Returns

Dataframe with extracted features

Return type

result

Raises
  • ValueError: – if input column contains zero or negative values

  • ValueError: – if quantile columns contains zero or negative values

transform(df: pandas.core.frame.DataFrame) pandas.core.frame.DataFrame[source]

Subtract seasonal component.

Parameters

df (pandas.core.frame.DataFrame) – Features dataframe with time

Returns

Dataframe with extracted features

Return type

result

Raises

ValueError: – if input column contains zero or negative values