Z-Score
Last Updated: July 29, 2026 | By Mihail Sebastian | AI Dictionary
The number of standard deviations a data point sits above or below the mean, used to standardize features and flag outliers in machine learning.
What is a Z-Score?
A z-score measures how many standard deviations a data point sits above or below the mean of its dataset. A z-score of 0 means the value equals the mean; +2 means two standard deviations above it; negative values fall below.
The point of the conversion is comparability. Once values are expressed in standard-deviation units, a test score, a house price, and a sensor reading all live on the same scale.
How a Z-Score Works
The calculation takes one line:
\[ Z = \frac{X - \mu}{\sigma} \]where \(X\) is the data point, \(\mu\) is the mean, and \(\sigma\) is the standard deviation. Applied to every value in a dataset, this produces a distribution with mean 0 and standard deviation 1 – a transformation called standardization.
If the data follows a normal distribution, z-scores also carry probability information. A value with a z-score beyond ±3 belongs to roughly the rarest 0.3% of the data, which is why a fixed z-score threshold is one of the simplest outlier tests.
Applications of Z-Scores
- Feature scaling: Standardizing features before training keeps one large-valued column (income in dollars) from dominating a small-valued one (age in years); gradient descent also converges faster on standardized inputs.
- Anomaly detection: Points whose z-scores exceed a threshold, such as |Z| > 3, get flagged as candidates for fraud, sensor faults, or data errors.
- Cross-dataset comparison: Z-scores let you ask whether a value is unusual for its own population, regardless of units.
Example of a Z-Score Calculation
A student scores 85 on a test where the class average is 80 and the standard deviation is 5:
\[ Z = \frac{85 - 80}{5} = 1 \]The score sits exactly one standard deviation above the class mean. If a second class had an average of 70 with a standard deviation of 15, a score of 85 there would give \(Z = 1\) as well – the same relative standing despite different raw numbers, which is precisely what the z-score is built to reveal.
Related AI terms: Normal Distribution · Hypothesis Testing · Anomaly Detection · Feature Engineering
Did you like the Z-Score gist?
Learn about 250+ need-to-know artificial intelligence terms in the AI Dictionary.
Mihail Sebastian — Writes about AI governance, regulation, and the technology behind them. Placeholder bio — replace with a real credential line. About