_OneSegmentLogTransform

class _OneSegmentLogTransform(in_column: str, base: int = 10, inplace: bool = True, out_column: Optional[str] = None)[source]

Bases: etna.transforms.base.Transform

Instance of this class applies logarithmic transformation to one segment data.

Init OneSegmentLogTransform.

Parameters
  • in_column (str) – column to apply transform.

  • base (int) – base of logarithm to apply to series.

  • inplace (bool) –

    • if True, apply logarithm transformation inplace to in_column,

    • if False, add transformed column to dataset.

  • out_column (Optional[str]) – name of added column. If not given, use self.__repr__()

Inherited-members

Methods

fit(df)

Fit preprocess method, does nothing in OneSegmentLogTransform case.

fit_transform(df)

May be reimplemented.

inverse_transform(df)

Apply inverse transformation to the series from df.

transform(df)

Apply log transformation to series from df.

fit(df: pandas.core.series.Series) etna.transforms.math.log._OneSegmentLogTransform[source]

Fit preprocess method, does nothing in OneSegmentLogTransform case.

Parameters

df (pandas.core.series.Series) –

Return type

etna.transforms.math.log._OneSegmentLogTransform

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

Apply inverse transformation to the series from df.

Parameters

df (pandas.core.frame.DataFrame) – series to transform

Returns

transformed series

Return type

pandas.core.frame.DataFrame

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

Apply log transformation to series from df.

Parameters

df (pandas.core.frame.DataFrame) – series to transform

Returns

transformed series

Raises

ValueError: – if given series contains negative samples

Return type

pandas.core.frame.DataFrame