Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Machine Failure Prediction

This internship project builds a machine learning model to predict whether a machine is likely to fail based on operational and sensor-related readings.

Objective

The goal is to classify machine records into:

  • 0: No failure
  • 1: Failure

The final model uses a Random Forest Classifier because it performs well on tabular data, handles non-linear relationships, and provides feature importance for interpretation.

Dataset

The dataset contains 944 records and the following columns:

Column Description
footfall Number of people or activity count around the machine
tempMode Temperature mode value
AQ Air quality reading
USS Ultrasonic sensor reading
CS Current sensor reading
VOC Volatile organic compound reading
RP Rotational position or related machine parameter
IP Input pressure or related machine parameter
Temperature Temperature reading
fail Target variable showing machine failure status

Target distribution:

  • No failure: 551 records
  • Failure: 393 records

Project Structure

.
+-- machine_failure_data.csv
+-- major_project_machine_failure.ipynb
+-- src/
|   +-- train_model.py
|   +-- model_comparison.py
|   +-- data_quality_check.py
|   +-- predict.py
|   +-- run_pipeline.py
|   +-- config.py
+-- tests/
|   +-- test_project.py
+-- models/
+-- reports/
+-- app.py
+-- sample_input.csv
+-- README.md
+-- PROJECT_REPORT.md
+-- MODEL_CARD.md
+-- PORTFOLIO_NOTES.md
+-- DATA_DICTIONARY.md
+-- TOP_IMPROVEMENTS.md
+-- IMPROVEMENT_TIPS.md
+-- SUBMISSION_CHECKLIST.md
+-- PRESENTATION_OUTLINE.md
+-- requirements.txt
+-- minor_project_python_basics.md

Methodology

  1. Load and inspect the dataset.
  2. Check missing values and class distribution.
  3. Split the data using a stratified train-test split.
  4. Train a Random Forest Classifier.
  5. Evaluate the model using accuracy, precision, recall, F1-score, and confusion matrix.
  6. Analyze feature importance.
  7. Save the trained model for reuse.

How To Run

Install dependencies:

pip install -r requirements.txt

Run the training script:

python src/train_model.py

Compare multiple models:

python src/model_comparison.py

Generate a data quality report:

python src/data_quality_check.py

Run the complete pipeline:

python -m src.run_pipeline

Run a sample prediction:

python src/predict.py

Run validation tests:

python -m unittest discover -s tests

Run the optional prediction dashboard:

streamlit run app.py

The trained model will be saved in:

models/random_forest_machine_failure_model.joblib

The metrics report will be saved in:

reports/model_metrics.txt

Additional generated reports:

reports/data_quality_report.txt
reports/feature_summary.csv
reports/model_comparison.csv
reports/feature_importance.csv
reports/test_predictions.csv

Important improvement notes are documented in:

TOP_IMPROVEMENTS.md
IMPROVEMENT_TIPS.md

Tools Used

  • Python
  • Pandas
  • Scikit-learn
  • Joblib
  • Jupyter Notebook
  • Streamlit

Portfolio Quality Additions

  • Centralized project configuration in src/config.py
  • One-command pipeline runner
  • Basic validation tests
  • Model card with intended use and limitations
  • Portfolio notes for GitHub or resume use

Key Results

  • Test accuracy: 91.01%
  • Cross-validation accuracy: 87.29%
  • Most important features: VOC, AQ, and USS

Conclusion

The project demonstrates an end-to-end machine learning workflow for predictive maintenance. By using sensor and operational features, the model can help identify machine failure risk and support early maintenance decisions.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages