What is Feature Scaling?

A maintenance team combines machine temperature with operating hours for a prediction model. The features use different units, so the team checks whether their scales affect training.

The scikit-learn preprocessing guide describes standardization and min-max scaling among its preprocessing methods. The guide also describes a scaler that uses statistics less affected by outliers.

Standardization centers a feature using its training mean and scales it using its training standard deviation. Min-max scaling uses the training minimum and maximum to map values into a chosen range; values outside the training range can fall outside that range later.

Choose and check a scaling approach for the task:

  • Inspect units, distributions and missing values in numeric features.
  • Select a transformation appropriate to the model and the data.
  • Fit scaling parameters on training data and apply them to evaluation data.
  • Compare alternatives on the same evaluation records and task metric.

How is Feature Scaling different from data normalization?

  • Feature scaling is a broad term for changing the scale of numeric inputs.
  • Data normalization can mean rescaling values in statistics and machine learning, or organizing database tables to reduce redundancy. Context determines the meaning.
  • Standardization and min-max scaling are specific transformations; a team should name the method and parameters when documenting an experiment.

Where does Feature Scaling break in AI work?

Fitting a scaler before separating training and test records introduces data leakage. The scikit-learn guidance on common pitfalls recommends splitting before preprocessing and excluding test data when fitting transformations.

Extreme values can compress the bulk of a feature into a narrow part of a min-max range. Review outliers and compare suitable transformations on the same evaluation records. Decision tree models usually need little scaling, although the full modeling pipeline may include other scale-sensitive steps.

Frequently asked questions

Should every numeric feature be scaled?

No. The choice depends on the model and the meaning and distribution of each feature.

Can a scaler use evaluation data to calculate its parameters?

Fit the scaler on training data, then apply the fitted transformation to evaluation data. Using evaluation data during fitting leaks information into training.

Does scaling remove outliers?

Scaling changes values; it does not necessarily remove unusual observations. Inspect outliers separately and decide how the task should handle them.