Data Mining · CSC213

Data Normalization: Min-Max, Z-Score and Decimal Scaling with Examples

Data Mining Study guides

Normalization rescales attribute values to a common range so attributes with large values do not dominate distance-based methods.

Min-max normalization maps values to a new range, usually 0 to 1: v' = (v - min) / (max - min) x (new_max - new_min) + new_min. It preserves the relationships among the original values but is sensitive to outliers and fails for new values outside the original range.

Z-score normalization (zero-mean) uses the mean and standard deviation: v' = (v - mean) / std. After it, the attribute has mean 0 and standard deviation 1. It handles outliers better than min-max. Decimal scaling moves the decimal point: v' = v / 10 to the power j, with the smallest j such that the largest absolute value becomes less than 1.

Why normalize: methods such as k-nearest neighbours and clustering use distances, so an attribute measured in thousands (income) would swamp one measured in tens (age). Normalization, aggregation, sampling and attribute construction are all kinds of data transformation, and scaling techniques are part of it.

Key points

  • Min-max: (v - min) / (max - min), result 0 to 1 by default.
  • Z-score: (v - mean) / std; mean 0, std 1.
  • Decimal scaling: divide by 10^j so |v| < 1.
  • Normalization stops large-valued attributes dominating distances.
  • Min-max is sensitive to outliers.

Worked example

Values 2, 4, 6, 8. Min-max: (2-2)/6 = 0, 0.33, 0.67, 1. Z-score: mean = 5, population std = sqrt(5) = 2.24, so 8 becomes (8 - 5) / 2.24 = 1.34 and 2 becomes -1.34. (Using the sample std, 2.58, gives 1.16 instead, so check which one your course uses.)

Common questions

What is the z-score formula?

z = (value - mean) / standard deviation.

When is min-max a problem?

When there are outliers: one extreme value squeezes the rest into a tiny part of the 0 to 1 range.

Practice questions on this topic

Try these, then open the app to check your answers with explanations.

  1. Compute the z-score of the values: 12 14 16 18 19 23
    • A. 0 0.18 0.36 0.55 0.64 1
    • B. -1.40 -0.84 -0.28 0.28 0.56 1.68
    • C. 1.40 0.84 0.28 -0.28 -0.65 -1.68
  2. Random sampling is a data transformation technique used for:
    • A. Balancing imbalanced datasets
    • B. Removing noisy data points from the dataset
    • C. Reducing the size of a large dataset
    • D. None of the above
  3. Which of the following is NOT a benefit of data transformation?
    • A. Enhanced model performance
    • B. Improved data quality
    • C. Increased computation time
    • D. Increased interpretability of results
  4. Which of the following(s) is/are features scaling techniques?
    • A. Standardization
    • B. Min-Max Scaling
    • C. Normalization
    • D. All of the Above