Tool-life prediction for CNC lathes

Validated and handed over Jun to Jul 2026
  • Python
  • pandas
  • scikit-learn
  • XGBoost
  • Quarto

I rebuilt a tool-life prediction pipeline in Python to test whether machine logs could better support tool-change decisions. The analysis covered tens of millions of records across multiple production environments.

−26%per-tool error on remaining life
Previous modelbaseline
Final−26%

Relative per-tool error on remaining life. The revised approach reduced error by 26%. Lower is better.

Method and results

  1. Validation used cycle-grouped splits over 5 and 20 seeds, a time-based split, walk-forward folds and leave-one-machine-out.
  2. The counter was almost uncorrelated with available load signals and behaved like an output quota rather than a wear measurement. I reframed the system as decision support for tool changes.
  3. XGBoost reduced error by about 15% against the previous approach. Excluding invalid source data accounted for the remaining improvement.
  4. Adding the raw counter as a feature produced implausibly good results. That was leakage, so the feature stayed out of the model.
  5. A simple deterministic rule outperformed my own ML monitor for a data-quality check, so I recommended the rule.
  6. I recommended a controlled operational trial before any change to tool-change policy.