Skip to content

Jasonwill2004/ai-car-maintenance-predictor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚗 AI Car Maintenance Predictor

Python Streamlit Scikit-learn License

Predict maintenance costs and component failure risks for cars using machine learning and real-world data.

Live Demo: Try the Dashboard (Deploy to get this link)

AI Car Maintenance Predictor

✨ Features

  • 🚗 40+ Car Models: Including luxury (BMW, Audi, Mercedes) and electric vehicles
  • 🤖 ML Predictions: RandomForest models for cost prediction and failure classification
  • 📊 Interactive Dashboard: Streamlit web interface with real-time predictions
  • 🔄 Car Comparison: Compare maintenance costs between different vehicles
  • ⛽ 6 Fuel Types: Petrol, Diesel, CNG, Electric, Hybrid, LPG
  • 🧠 Smart Recommendations: AI-powered maintenance advice based on usage patterns

📁 Project Structure

AI_Car_Maintenance_Predictor/
├── data/
│   ├── raw/             # Raw scraped data
│   └── processed/       # Cleaned and feature-engineered data
├── src/
│   ├── scraper.py       # Web scraping scripts
│   ├── preprocess.py    # Data cleaning and feature engineering
│   ├── train_model.py   # ML training (regression/classification)
│   └── utils.py         # Helper functions
├── app/
│   └── dashboard.py     # Streamlit dashboard
├── requirements.txt     # Python dependencies
└── README.md

🛠️ Setup

  1. Install dependencies:

    pip install -r requirements.txt
  2. Run the data pipeline:

    # Step 1: Scrape data (optional - sample data included)
    python src/scraper.py
    
    # Step 2: Preprocess data
    python src/preprocess.py
    
    # Step 3: Train models
    python src/train_model.py
  3. Launch dashboard:

    streamlit run app/dashboard.py

📊 Usage

Data Pipeline

  1. Scraping: Collect car maintenance discussions from forums
  2. Preprocessing: Clean data and engineer features
  3. Training: Build ML models for cost and failure prediction
  4. Prediction: Use dashboard for interactive predictions

Dashboard Features

  • Input car details (model, mileage, age, fuel type)
  • Get maintenance cost predictions
  • View component failure risk analysis
  • Explore data visualizations

🧠 ML Models

  • Cost Prediction: RandomForestRegressor for maintenance cost estimation
  • Failure Classification: RandomForestClassifier for component failure risk
  • Features: Mileage, age, fuel type, usage patterns, service history

🎯 Key Metrics

  • Cost Prediction: Mean Absolute Error (MAE), R² Score
  • Failure Prediction: Accuracy, Precision, Recall, F1-Score

📈 Future Enhancements

  • More data sources (manufacturer websites, service centers)
  • Advanced ML models (XGBoost, Neural Networks)
  • Real-time data updates
  • Mobile app interface
  • AI-powered insights with LangChain + OpenAI

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📊 Model Performance

  • Cost Prediction: MAE ₹1,660 | R² Score 0.822 (82% accuracy)
  • Failure Classification: 100% accuracy on test data
  • Cross Validation: R² Score 0.624 ± 0.569

🌟 Screenshots

Dashboard Interface

![Dashboard] Screenshot 2025-10-14 at 3 10 15 PM

📄 License

This project is open source and available under the MIT License.

👨‍💻 Author

Jason William


Don't forget to give this project a star if you found it helpful!

Built with ❤️ using Python, Scikit-learn, and Streamlit

About

AI-powered car maintenance cost predictor using ML and Streamlit dashboard

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors