This project focuses on Predictive Maintenance for CNC machines using a dataset of 10,000 records. The goal is to predict machine failures before they happen by analyzing sensor data (Temperature, Torque, Rotational Speed, etc.).
Moving from "Reactive Maintenance" to allows factories to reduce downtime and save costs.
- Handling Multicollinearity:
- Detected a high correlation (0.88) between
Air_TempandProcess_Temp. - Removed
Air_Tempto reduce redundancy and improve model stability.
- Detected a high correlation (0.88) between
- Data Preprocessing:
- Used
StandardScalerto normalize features with different units (e.g., RPM vs. Torque).
- Used
- Handling Imbalanced Data (Crucial Step):
- The dataset was highly imbalanced (96% Normal vs. 4% Failure).
- Initial models failed to detect failures (Recall was ~30%).
- Applied SMOTE (Synthetic Minority Over-sampling Technique) to balance the classes. This significantly improved the model's ability to learn failure patterns.
- Evaluation Metrics:
- Evaluated models using Accuracy, Recall (Sensitivity), and F1-Score to ensure a balanced performance.
The Random Forest Classifier achieved the best overall performance.
| Model | Accuracy | Recall | F1-Score | Verdict |
|---|---|---|---|---|
| Logistic Regression (Base) | 97.4% | ~30% | Low | Missed most failures |
| Logistic Regression (SMOTE) | 80.0% | 79% | Moderate | Good detection, lower precision |
| Decision Tree | 93.8% | High | Moderate | Prone to overfitting |
| Random Forest (Final) | 94.2% | High & Stable | Balanced | Best Model |
The model successfully identifies the majority of machine failures while keeping false alarms low.
According to the Random Forest analysis, Torque and Rotational Speed are the most critical indicators of a potential failure.
The model shows excellent discrimination with an AUC score of 0.95.


