ScottDuncanAI

TEP Claude Code — AI skill for Claude Code

AI community

Machine learning and MSPC models trained to detect faults on the Tennessee Eastman Process dataset.

How to install TEP Claude Code

This entry records only its repository, not the path inside it, so there is no exact command to give. Open ScottDuncanAI/TEP-Claude-Code and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What TEP Claude Code does

Machine learning and MSPC models trained to detect faults on the Tennessee Eastman Process dataset. Models built using Claude Code.

Alternatives in AI

README

TEP Fault Detection: MSPC vs. Machine Learning

A benchmark comparison of **Multivariate Statistical Process Control (MSPC)** and modern **ML classifiers** for fault detection on the Tennessee Eastman Process (TEP) — a classic chemical engineering simulation used widely in process monitoring research.


Background

The **Tennessee Eastman Process** (Downs & Vogel, 1993) is a realistic simulation of a chemical plant with 5 major unit operations, 52 measured variables (41 process measurements + 11 manipulated variables), and 20 distinct fault types. It has become the standard benchmark for evaluating process monitoring and fault detection methods.

This project asks a practical question: **how does traditional MSPC (PCA-based) compare to modern ML classifiers** when detecting faults across all 20 fault types?

Key Design Choice: Post-Fault Evaluation

In the TEP dataset, faulty simulations share samples 1–159 with normal operation — the fault is only introduced at sample 160. Evaluating on the full test set is therefore misleading, as pre-fault samples are labeled "faulty" but are indistinguishable from normal. All models in this project are evaluated on **post-fault samples only (sample ≥ 160)**, which reflects realistic detection performance.


Models Compared

Model Type Trains On
MSPC T² Hotelling T² statistic, 99% F-distribution limit Fault-free data only
MSPC SPE Squared Prediction Error (Q statistic), Jackson–Mudholkar limit Fault-free data only
MSPC Combined Alarm if T² or SPE exceeds limit Fault-free data only
Logistic Regression Linear classifier (SAGA solver, balanced class weight) Labeled fault-free + faulty
LightGBM Gradient boosted trees (early stopping) Labeled fault-free + faulty
Random Forest Bagged trees (balanced subsample) Labeled fault-free + faulty
XGBoost Gradient boosted trees (hist method, early stopping) Labeled fault-free + faulty

MSPC uses