본문으로 건너뛰기
Workshop overview
Chapter 3 of 7
15 min

Understand the three-sigma check intuitively

Measure how far each reading sits from the norm for its sensor type, and see how the statistical rule and the condition signal split the work of assigning severity.

Question for this chapter

What does a three-sigma check find, and how does an explicit condition signal change its result?

Why this matters now

Sigma is unfamiliar statistical vocabulary, but its job is simple. It converts each reading into a single number: how many standard deviations it sits from the norm for that sensor type. That puts sensors with different units on one relative scale.

Try it

Open the anomaly_detection pipeline under processed and select Run. It executes sensor_normalization and then anomaly_detection to produce anomaly_detections.

Check the normalization result first — 216 rows become 213.

  • The two OFFLINE rows are an unsupported state, so they are removed.
  • Five of the six missing values are carried forward from the previous reading.
  • CNC-08's pressure gap runs four readings long, past the fill limit of 3, so one row cannot be kept.

Read these two rules separately in the code.

Detection rule: |value − mean for that sensor type| / stddev > sigma  →  anomaly
Condition rule: quality_flag starting with HIGH_ → anomaly regardless of z-score, severity HIGH
Severity:       condition signal or z >= 5.0 → HIGH,  z >= 4.0 → MEDIUM,  otherwise → LOW

What success looks like

anomaly_detections contains six rows.

MachineSensorValuez-scoreSeverityWhy it became an anomaly
CNC-03vibration4.716.89HIGHcondition signal + statistics
CNC-05pressure8.94.92HIGHcondition signal + statistics
CNC-09temperature103.74.60HIGHcondition signal + statistics
CNC-07temperature101.24.22HIGHcondition signal + statistics
CNC-01temperature99.84.00MEDIUMstatistics only
CNC-02vibration2.753.27LOWstatistics only
Korean Portal showing anomaly detections with CNC-03, CNC-05, and CNC-09 marked HIGH
The Portal capture is in Korean. Confirm the z-score, severity, and source quality signal for all six anomaly rows.

Find where the two rules diverge

Put CNC-01 and CNC-07 side by side. Both are temperature sensors and their z-scores are nearly identical at 4.00 and 4.22. Yet their severities split into MEDIUM and HIGH.

The difference is not the z-score — it is quality_flag. CNC-07's source row carries HIGH_TEMP while CNC-01's is OK. A condition signal pins severity to HIGH even when the z-score falls short of 5.0.

Change the threshold and confirm

Change sigma_multiplier in the anomaly_detection code and rerun.

sigma_multiplierAnomaliesRow that drops out
3.0 (default)6
3.35CNC-02 LOW (z 3.27)
4.14CNC-01 MEDIUM (z 4.00)

Even at 4.1 the four HIGH rows remain, because rows carrying a condition signal are preserved independently of the statistical rule. Restore 3.0 after the experiment.

Next decision

You have separated the six anomalies by origin. In the next chapter, compress them into machine-level scores and choose the first inspection among the four HIGH machines.