class RobustScalerTransform(in_column: Optional[Union[str, List[str]]] = None, inplace: bool = True, out_column: Optional[str] = None, with_centering: bool = True, with_scaling: bool = True, quantile_range: Tuple[float, float] = (25, 75), unit_variance: bool = False, mode: Union[etna.transforms.math.sklearn.TransformMode, str] = 'per-segment')[source]

Bases: etna.transforms.math.sklearn.SklearnTransform

Scale features using statistics that are robust to outliers.

Uses sklearn.preprocessing.RobustScaler inside.


This transform can suffer from look-ahead bias. For transforming data at some timestamp it uses information from the whole train part.

Init RobustScalerPreprocess.

  • in_column (Optional[Union[str, List[str]]]) – columns to be scaled, if None - all columns will be scaled.

  • inplace (bool) – features are changed by scaled.

  • out_column (Optional[str]) – base for the names of generated columns, uses self.__repr__() if not given.

  • with_centering (bool) – if True, center the data before scaling.

  • with_scaling (bool) – if True, scale the data to interquartile range.

  • quantile_range (Tuple[float, float]) – quantile range.

  • unit_variance (bool) –

    If True, scale data so that normally distributed features have a variance of 1.

    In general, if the difference between the x-values of q_max and q_min for a standard normal distribution is greater than 1, the dataset will be scaled down. If less than 1, the dataset will be scaled up.

  • mode (Union[etna.transforms.math.sklearn.TransformMode, str]) –

    “macro” or “per-segment”, way to transform features over segments.

    • If “macro”, transforms features globally, gluing the corresponding ones for all segments.

    • If “per-segment”, transforms features for each segment separately.


ValueError: – if incorrect mode given




Fit transformer with data from df.


May be reimplemented.


Apply inverse transformation to DataFrame.


Transform given data with fitted transformer.