What does StandardScaler do in scikit-learn and when should it be applied?

Data Science with Python Medium

Data Science with Python — Medium

What does StandardScaler do in scikit-learn and when should it be applied?

Key points

  • StandardScaler standardizes features to zero mean and unit variance
  • Fitted on training data only to avoid data leakage
  • Applied to both train and test sets
  • Prevents differences in scale affecting model performance

Ready to go further?

Related questions