RobustScaler
RobustScaler is a data preprocessing transformer in scikit-learn designed to scale features in a way that is resistant to outliers. It is commonly used in machine learning pipelines to normalize data without being unduly influenced by extreme values, making it preferable for datasets with skewed distributions or outliers.
The transformation works by centering and scaling each feature using robust statistics. Specifically, it subtracts the
- with_center: whether to center the data by subtracting the median (default True).
- with_scaling: whether to scale by the IQR (default True).
- quantile_range: the lower and upper quantiles used to compute the IQR (default (25.0, 75.0)).
- copy: whether to return a copy of the input data (default True).
RobustScaler is suitable when features contain outliers or heavy-tailed distributions, providing a more robust alternative to