TSAD: A Python Library for Solving ML Problems in Industry

Vyacheslav Kozitsin25 May 2024

Problem

A data scientist arrives at a new shop or production unit and has to learn quickly whether ML can detect equipment faults there. The data is messy and special ML algorithms barely exist, so each project rebuilds preprocessing and evaluation from scratch. Point-wise precision and recall look fine to the analyst but do not match how engineers judge a model: they count failures caught and wasted trips to the equipment.

Example from the article: on a two-failure example, point-wise recall is 4/20 = 0.2 and precision 4/6 = 0.67, while window-based recall is 1/2 = 0.5 and precision 1/3 = 0.33. The second pair is what the process engineer and the mechanic actually experience.

Solution in brief

TSAD is an open Python library of ready pipelines (fault detection, time series forecasting) built from small tasks that pass state to each other. A pipeline gives a quick baseline on raw data and can be cut apart for research. The library also ships window-based failure metrics and built-in predictive-maintenance datasets.

Questions this case answers
  • How to detect faults in sensor time series with a reusable pipeline that gives a quick baseline on each new unit
  • How to evaluate event detection on time series by time windows around failures instead of by individual points
  • How to build a reusable pipeline for fault detection and forecasting on industrial time series
  • How to evaluate anomaly detection by failure windows instead of by points

Tools and methods

  • TSAD — Pipeline, Task and TaskResult classes, ready pipelines, metrics, datasets
  • Residual anomaly detection — forecast the next step, flag a fault when prediction and actual diverge
  • Window-based metrics — recall and precision per failure window; NAB score; average detection time
  • Built-in datasets — SKAB, NASA Turbofan, Tennessee Eastman Process, Exhauster and others
Continue reading — it's free

Google or a one-time email code. No password.