In our last lesson, we explored Min-Max normalization, a technique for scaling features into a fixed [0, 1] range. We saw how this is crucial for certain algorithms but also noted its primary weakness: high sensitivity to outliers. Today, we turn our attention to another, often more robust, method of scaling: standardization.
This lesson will introduce you to Z-score scaling, or standardization. You will learn how to transform data not to a fixed range, but based on its own statistical propertiesโits mean and standard deviation. We will explore the primary goal of this transformation and uncover its fundamental relationship with one of the most important concepts in statistics: the normal distribution.
From Scaling by Range to Scaling by Spread
In the previous lesson, we scaled features by squishing them between a minimum and maximum value. Standardization takes a different approach. Instead of focusing on the extremes of the data, it focuses on the center and the spread. The central question it answers for each data point is: "How far away is this point from the average, measured in units of the data's own spread?"
This measure is called a Z-score.

A Z-score tells us exactly how many standard deviations a data point is from the mean of its distribution. The formula is beautifully simple:
Where:
- is the original data point (a raw score).
- (mu) is the mean of the distribution.
- (sigma) is the standard deviation of the distribution.
The process of converting a dataset of raw scores () into Z-scores () is called standardization.
Let's ground this in a formal definition.
Chapter 6: z-scores and the Standard Normal Distribution
This resource from Maricopa Community Colleges provides a clear introduction to Z-scores.
Please read the section titled z-scores. It begins just after the list of features for the normal distribution. Focus on the definition of a Z-score as a standardized version and the provided formulas for a population and a sample. Note the explanation that Z-scores combine information about the center (\mu) and spread (\sigma) to interpret a raw score.
Interpreting the Z-score
The power of a Z-score lies in its immediate interpretability. Every Z-score gives you two pieces of information:
-
The Sign (positive or negative):
- A positive Z-score means the data point is above the mean.
- A negative Z-score means the data point is below the mean.
- A Z-score of zero means the data point is exactly at the mean.
-
The Magnitude (the number itself):
- The value indicates how many standard deviations the point is from the mean. A Z-score of +2.0 means the point is 2 standard deviations above the mean. A Z-score of -0.5 means it is half a standard deviation below the mean.
The following reading builds on the previous one and provides concrete examples of this interpretation.
Chapter 6: z-scores and the Standard Normal Distribution
Continuing with the same resource, this section explains how to read and understand Z-scores.
Start reading from the beginning of this text block, which discusses the sign and magnitude. Then, review the example calculation where a test score of 68 is converted to a Z-score of 1.75, changing the perspective on the performance.
The Goal: Creating a Universal Yardstick
Why go through the trouble of this transformation? One of the primary goals of standardization is to create a common scale for comparison. By converting values from different distributions into Z-scores, we can compare them directly, even if their original units, means, and standard deviations are wildly different.
Imagine two students, one in a Chemistry class and one in a Physics class. Both score 76 on their final exams. Who performed better relative to their peers? Without more information, it's impossible to say. But with the mean and standard deviation of each class, we can use Z-scores to find out.
Chapter 6: z-scores and the Standard Normal Distribution
This section provides an excellent, practical example of using Z-scores for comparison.
Focus on the part titled Example comparing raw scores. Follow the logic for the Chemistry and Physics exam scores. Notice how even though the raw scores are identical, the Z-scores reveal that a 76 in Chemistry (z = +2.00) is a much stronger performance than a 76 in Physics (z = +0.50).
This ability to compare "apples and oranges" is invaluable in data analysis and machine learning, where you often work with features measured in completely different units (e.g., age in years, income in dollars, height in meters).
The Link to the Normal Distribution
Here we arrive at the most profound consequence of standardization. When you standardize a variable, you are fundamentally changing its distribution's parameters. The resulting set of Z-scores will always have a mean of 0 and a standard deviation of 1.
If the original distribution was a normal distribution (the classic "bell curve"), then standardization transforms it into a very special case called the Standard Normal Distribution.
- Normal Distribution: Any bell-shaped curve defined by its mean and standard deviation .
- Standard Normal Distribution: A single, specific normal distribution with a mean and a standard deviation .
This is an incredibly powerful idea: we can take any normally distributed variable, regardless of its mean or standard deviation, and convert it into one universal, standard form. This allows us to use a single reference (the standard normal distribution) to analyze probabilities for any normal variable.
The following video brilliantly illustrates this transformation process.
Z-Scores, Standardization, and the Standard Normal Distribution (5.3)
This video from Simple Learning Pro provides a clear visual explanation of standardization and its connection to the standard normal distribution.
Please watch the following segments: Introduction: Watch from the beginning to the first minute to understand the definition of the standard normal distribution and what a Z-score represents on it. The Standardization Process: Jump to this section, which explains how any normal distribution can be transformed into the standard one using the Z-score formula. Worked Example: Watch from this example of chemistry exam scores. It shows step-by-step how a raw score (49) is converted to a Z-score (-1.1) to find its relative position. (You can ignore the mention of the Z-table and "exact area" for now; we'll cover that in the next lesson).
A Critical Clarification
Given your background in computer science, you'll appreciate this point of precision. A common misconception is that standardization makes data normally distributed. This is not true. Standardization is a linear transformation (, where and ). It changes the mean and standard deviation, but it does not change the fundamental shape of the distribution.
If you standardize a skewed distribution, the result will still be skewed, but it will now have a mean of 0 and a standard deviation of 1.
Standardization vs Normalization Clearly Explained!
This is the same video from the "Normalized Nerd" channel we viewed in the last lesson. This time, we'll focus on its explanation of standardization.
Watch the section from this point. The creator does an excellent job of visually demonstrating that standardizing a skewed distribution does not make it normal, it simply shifts and scales it.
Standardization vs. Normalization
Let's conclude by revisiting the comparison with Min-Max normalization.
- Range: Normalization scales data to a fixed range, typically [0, 1]. Standardization does not have a fixed range; it centers the data at 0 and scales it by its standard deviation.
- Outliers: As we saw, normalization is very sensitive to outliers. Standardization is far more robust. Since the mean and standard deviation are less influenced by single extreme points than the min and max are, outliers have less impact on the overall transformation.
- Distribution: Standardization is required when you need to compare values from different normal distributions or when a model assumes features are centered at zero. Normalization is often used in algorithms that don't make assumptions about the distribution, such as K-Nearest Neighbors, or in neural networks where inputs in the [0, 1] range are desirable.
Conclusion
In this lesson, we've unpacked the concept of standardization, or Z-score scaling. It provides a powerful alternative to the Min-Max normalization we studied previously, one that is grounded in the statistical properties of the data itself.
Key Takeaways:
- Standardization is a scaling technique that transforms data to have a mean of 0 and a standard deviation of 1.
- A Z-score represents the number of standard deviations a data point is from its mean. It is calculated as .
- The primary goal is to create a common scale for comparing values from different distributions and to prepare data for certain machine learning models.
- Standardization transforms any normal distribution into the Standard Normal Distribution (), but it does not change the shape of a non-normal distribution.
- Compared to Min-Max normalization, standardization is much more robust to outliers.
Now that we can convert any value from a normal distribution into a Z-score, what's next? In our upcoming lesson, we will learn how to use these Z-scores with a tool called a Z-table to find the precise probability of a value falling within any given range. This skill is a cornerstone of hypothesis testing and inferential statistics.