An interactive web application built with Streamlit that provides a comprehensive suite of tools for used car price analysis. This project leverages a variety of machine learning models to deliver accurate price predictions and offers rich, data-driven insights into the automotive market.
This application is organized into four main functional tabs:
-
Price Predictor: The main feature of the application. Users can input a car's details (make, model, year, etc.) and receive an estimated selling price. The prediction is generated by over ten competing machine learning models, which are then ranked to show the most reliable estimate.
-
Model Performance: To provide transparency, this page displays a detailed performance table for every model used in the predictor. You can directly compare key metrics like R-squared (R²) and Root Mean Squared Error (RMSE) to understand each model's accuracy.
-
Price Range Explorer: An interactive tool for market research. This page features a price slider that allows you to filter the entire dataset for cars within a specific budget. The visualizations on the page dynamically update to show which car makes and models are most common in your selected price range.
-
Market Insights: This page offers a high-level exploratory data analysis (EDA) of the complete dataset. It includes visualizations of overall market trends, such as the distribution of car prices, the relationship between mileage and price, and how the average car value has changed by manufacturing year.
This project was built using a data science and web development stack:
- Core Framework: Streamlit
- Data Manipulation: Pandas, NumPy
- Machine Learning: Scikit-learn, XGBoost, LightGBM
- Data Visualization: Plotly Express
- Model Persistence: Joblib
The project follows a modular structure to ensure code clarity and maintainability.
car-price-predictor/
├── src/
│ ├── data/processed/ # Processed dataset
│ ├── saved_models/ # Trained .joblib model files
│ └── saved_scalers/ # Saved .pkl scaler file
├── app/
│ ├── init.py
│ ├── config.py # Stores paths, constants, and model configs
│ ├── utils.py # Helper functions for loading data/models
│ ├── ui_components.py # Reusable Streamlit UI functions
│ └── views/ # Modules for each app tab
│ ├── predictor.py
│ ├── explorer.py
│ └── insights.py
├── app.py # Main application entry point
├── style.css # Custom CSS for UI styling
├── assets/ # Folder for UI images
├── requirements.txt # Project dependencies
└── README.md
To run this project on your local machine, follow these steps:
-
Clone the Repository
git clone [https://github.com/Henildiyora/car-price-predictor.git](https://github.com/Henildiyora/car-price-predictor.git) cd car-price-predictor -
Create and Activate a Virtual Environment
# For macOS/Linux python3 -m venv venv source venv/bin/activate # For Windows python -m venv venv .\venv\Scripts\activate
-
Install Dependencies
pip install -r requirements.txt
-
Run the Streamlit App
streamlit run app.py
The application will open in a new tab in your web browser.