Skip to content

Repository files navigation

AI4I 2020 Predictive Maintenance Dataset

Python pandas scikit-learn matplotlib

A complete data analysis project for predictive maintenance based on the AI4I 2020 Predictive Maintenance Dataset.

This repository covers the full pipeline from data understanding, preprocessing, exploratory data analysis, intelligent modeling, to actionable maintenance recommendations.


Project Overview

Industrial equipment failure can cause significant downtime and economic loss. This project builds a reproducible analytical workflow to predict machine failure using sensor and operational data. The dataset contains 10,000 records of industrial machinery with a severe class imbalance: only 3.39% of samples are failures.

Key Objectives

  • Understand data quality, distributions, and feature relationships
  • Clean and engineer features for modeling
  • Explore failure patterns across product types and operating conditions
  • Build and compare multiple classification models
  • Deliver data-driven maintenance recommendations

Visualizations

The following figures are generated by the analysis scripts and saved to output/figures/.

Exploratory Data Analysis

Figure Description
Failure Distribution Overall distribution of normal vs. failure samples.
Failure Rate by Product Type Failure rate comparison across product types L, M, and H.
Temperature vs Failure Relationship between air/process temperature and failure occurrence.
Speed and Torque vs Failure Rotational speed and torque patterns colored by failure status.
Tool Wear vs Failure Tool wear accumulation and its impact on failure risk.
Failure Type Distribution Breakdown of five specific failure modes.
Correlation Heatmap Correlation matrix of numerical features.

Preprocessing and Modeling

Figure Description
Outlier Detection Boxplot-based outlier detection before preprocessing.
Confusion Matrix Comparison Confusion matrices across multiple models.
ROC Curve Comparison ROC curves for model comparison.
Metric Comparison Precision, recall, F1-score comparison.
Feature Importance Most influential features for failure prediction.

Dataset

Feature Description
Air temperature [K] Air temperature around the machine
Process temperature [K] Process temperature during operation
Rotational speed [rpm] Rotational speed of the machine
Torque [Nm] Torque applied during operation
Tool wear [min] Tool wear time in minutes
Type Product type: L (Low), M (Medium), H (High)
Machine failure Target variable: 0 = normal, 1 = failure
HDF / PWF / OSF / RNF / NF Five specific failure type flags
  • Total samples: 10,000
  • Failure rate: 3.39% (severely imbalanced)
  • Source: UCI Machine Learning Repository

Project Structure

.
├── 01_data_loading_and_understanding.py
├── 02_data_preprocessing.py
├── 03_exploratory_data_analysis.py
├── 04_modeling_and_evaluation.py
├── 05_maintenance_recommendations_and_conclusion.py
├── data/
│   ├── ai4i2020.csv
│   └── processed_data.csv
├── output/
│   └── figures/
├── requirements.txt
└── README.md
Script Purpose
01_data_loading_and_understanding.py Load data, print shape, dtypes, and summary statistics
02_data_preprocessing.py Handle missing values, outliers, encoding, scaling, and feature engineering
03_exploratory_data_analysis.py Generate 7+ analyses and 7+ visualization figures
04_modeling_and_evaluation.py Train and compare 5 models, handle class imbalance, evaluate performance
05_maintenance_recommendations_and_conclusion.py Summarize insights and provide actionable maintenance recommendations

Quick Start

# 1. Clone the repository
git clone https://github.com/lingchenlijing/AI4I-2020-Predictive-Maintenance-Dataset.git
cd AI4I-2020-Predictive-Maintenance-Dataset

# 2. Install dependencies
pip install -r requirements.txt

# 3. Run the pipeline in order
python 01_data_loading_and_understanding.py
python 02_data_preprocessing.py
python 03_exploratory_data_analysis.py
python 04_modeling_and_evaluation.py
python 05_maintenance_recommendations_and_conclusion.py

Note: The scripts should be run in order because later steps depend on outputs generated by earlier steps.


Key Findings

  • The dataset is severely imbalanced, requiring special handling such as class weights or resampling techniques.
  • Product type and tool wear are strongly associated with failure risk.
  • Temperature, torque, and rotational speed interactions reveal distinct failure clusters.
  • Tree-based ensemble models (e.g., Random Forest, Gradient Boosting) generally achieve better recall for the minority failure class.
  • Feature importance analysis highlights operational parameters that should be monitored in real time.

Maintenance Recommendations

Based on data analysis and modeling results:

  1. Prioritize high-wear and high-type components: Machines with high product type and elevated tool wear should be scheduled for inspection more frequently.
  2. Monitor temperature and torque interactions: Anomalous combinations of process temperature and torque are early indicators of potential failure.
  3. Implement condition-based maintenance: Use the trained model to score real-time operational data and trigger maintenance before failures occur.
  4. Address class imbalance in production monitoring: Failure events are rare; monitoring systems should be tuned to maximize recall rather than accuracy alone.
  5. Track specific failure modes separately: Different failure types (HDF, PWF, OSF, RNF, NF) have different physical causes and should be handled by specialized maintenance protocols.

License

This project is for educational and research purposes. The original dataset is provided by the UCI Machine Learning Repository.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages