Course contentsShow
← Data Science
Lesson 1376 of 2,14535. Statistical Anomaly DetectionFree lesson

What is the Z-Score Method?

Understanding how Z-scores measure distance from the mean in standard deviations to identify outliers.

What is the Z-Score Method?

You'll learn how Z-scores help you spot unusual data points by measuring how far they are from the average.

The Core Idea

Imagine you're tracking employee salaries at a company. Most people earn between 50Kand50K and 80K, but suddenly you see one person earning $500K. Is that unusual? The Z-score method answers this question mathematically.

A Z-score tells you how many standard deviations away a data point is from the mean (average). It standardizes your data so you can compare apples to apples, even across different scales or units.

The formula is simple:

Z = (X - μ) / σ

Where:

  • X is your data point
  • μ (mu) is the mean
  • σ (sigma) is the standard deviation

Understanding the Scale

Z-scores follow a predictable pattern:

  • Z ≈ 0: The value is close to average
  • Z = 1 or -1: One standard deviation away (fairly normal)
  • Z = 2 or -2: Two standard deviations away (getting unusual)
  • Z ≥ 3 or ≤ -3: Three or more standard deviations away (potential outlier!)

Why This Matters for Anomaly Detection

The beauty of Z-scores is they create a universal measuring stick. A salary of 500KmighthaveaZ−scoreof8,whileanormalsalaryof500K might have a Z-score of 8, while a normal salary of 65K might have a Z-score of 0.2. The higher the absolute value of the Z-score, the more unusual the observation.

Most analysts flag values with |Z| > 3 as potential anomalies, since in a normal distribution, 99.7% of data falls within ±3 standard deviations.

Key Takeaway: The Z-score method transforms data into standard deviations from the mean, making it easy to identify outliers using a simple threshold (typically |Z| > 3).