Z-Score Normalization
Standardizes features to zero mean and unit variance.
Formula
Variables
Example
x=85, \mu=70, \sigma=10: z = 1.5
How it works
Z-score normalization tells you how far a value is from the average, measured in standard deviations. Subtracting the mean recenters the data at 0, and dividing by the standard deviation rescales it so a spread of 1 represents one typical unit of variation. This works because it preserves relative position in the distribution while putting features on a common scale, which is especially useful when different variables have very different units or magnitudes.
When to use it
Use it when comparing or feeding multiple numeric features into a model that is sensitive to scale, such as distance-based methods or gradient-based learning. It is also useful when you want to interpret a value as unusually high or low relative to its dataset.
Worked example, step by step
Given x = 42, μ = 30, σ = 6 Step 1: Subtract the mean: 42 - 30 = 12 Step 2: Divide by the standard deviation: 12 / 6 = 2 Step 3: z = 2 Final answer: the z-score is 2, meaning the value is 2 standard deviations above the mean.
Common mistakes to avoid
- Using variance instead of standard deviation in the denominator
- Forgetting to subtract the mean before dividing
- Applying z-score normalization to categorical data or to data with a zero standard deviation
Did You Know?
Also called standardization; assumes roughly Gaussian data.
Share this formula
More in Data Science & ML
View allMean Squared Error (MSE)
BasicAverage of squared differences between predicted and actual values.
Root Mean Squared Error (RMSE)
BasicSquare root of MSE, in the same units as the target variable.
Mean Absolute Error (MAE)
BasicAverage of absolute differences between predictions and actual values.
Coefficient of Determination (R²)
IntermediateProportion of variance in the target explained by the model.
Classification Accuracy
BasicFraction of predictions that are correct.
Precision
IntermediateOf all positive predictions, the fraction that were correct.