_OneSegmentAddConstTransform¶
- class _OneSegmentAddConstTransform(in_column: str, out_column: str, value: float, inplace: bool = True)[source]¶
Bases:
etna.transforms.base.Transform
Init _OneSegmentAddConstTransform.
- Parameters
in_column (str) – column to apply transform
out_column (str) – name of added column
value (float) – value that should be added to the series
inplace (bool) –
if True, apply add constant transformation inplace to in_column,
if False, add transformed column to dataset
- Inherited-members
Methods
fit
(df)Fit preprocess method, does nothing in _OneSegmentAddConstTransform case.
fit_transform
(df)May be reimplemented.
Apply inverse transformation: subtract given value from all the series values.
transform
(df)Transform method: add given value to all the series values.
- fit(df: pandas.core.frame.DataFrame) etna.transforms.math.add_constant._OneSegmentAddConstTransform [source]¶
Fit preprocess method, does nothing in _OneSegmentAddConstTransform case.
- Parameters
df (pandas.core.frame.DataFrame) –
- Return type
etna.transforms.math.add_constant._OneSegmentAddConstTransform
- inverse_transform(df: pandas.core.frame.DataFrame) pandas.core.frame.DataFrame [source]¶
Apply inverse transformation: subtract given value from all the series values.
- Parameters
df (pandas.core.frame.DataFrame) – DataFrame to apply inverse transformation
- Returns
transformed series
- Return type
pandas.core.frame.DataFrame