Member-only story
Scale, Standardize, or Normalize with Scikit-Learn
When to use MinMaxScaler, RobustScaler, StandardScaler, and Normalizer
Many machine learning algorithms work better when features are on a relatively similar scale and close to normally distributed. MinMaxScaler, RobustScaler, StandardScaler, and Normalizer are scikit-learn methods to preprocess data for machine learning. Which method you need, if any, depends on your model type and your feature values.
This guide will highlight the differences and similarities among these methods and help you learn when to reach for which tool.
As often as these methods appear in machine learning workflows, I found it difficult to find information about which of them to use when. Commentators often use the terms scale, standardize, and normalize interchangeably. However, their are some differences and the four scikit-learn functions we will examine do different things.
First, a few housekeeping notes:
- The Jupyter Notebook on which this article is based can be found here.
- In this article, we aren’t looking at log transformations or other transformations aimed at reducing the heteroskedasticity of the errors.
- This guide is current as of scikit-learn v0.20.3.