LogTransform

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

Bases: etna.transforms.base.Transform

LogTransform applies logarithm transformation for given series.

Init LogTransform.

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 column 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 method does nothing and is kept for compatibility.

fit_transform(df)

May be reimplemented.

inverse_transform(df)

Apply inverse transformation to the dataset.

transform(df)

Apply log transformation to the dataset.

fit(df: pandas.core.frame.DataFrame) etna.transforms.math.log.LogTransform[source]

Fit method does nothing and is kept for compatibility.

Parameters

df (pandas.core.frame.DataFrame) – dataframe with data.

Returns

result

Return type

LogTransform

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

Apply inverse transformation to the dataset.

Parameters

df (pandas.core.frame.DataFrame) – dataframe with data to transform.

Returns

result – transformed series

Return type

pd.DataFrame

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

Apply log transformation to the dataset.

Parameters

df (pandas.core.frame.DataFrame) – dataframe with data to transform.

Returns

result – transformed dataframe

Return type

pd.Dataframe