This project is a simple machine learning-powered web application to predict car prices based on user inputs such as fuel type, engine type, engine size, and horsepower. The application is built with Flask, uses scikit-learn's DecisionTreeRegressor, and provides both USD and INR price predictions.
- Python 3
- Flask (Web Framework)
- Pandas (Data Handling)
- Scikit-learn (ML Model)
- Joblib (Model Persistence)
- Bootstrap 5 (Frontend Styling)
Car-Price-Prediction/
│
├── app.py # Main Flask Application
├── car.csv # Training Data (Features & Target)
├── model.joblib # Saved Machine Learning Model
├── requirements.txt # Project Dependencies
├── templates/
│ └── car.html # HTML Template for Frontend
└── static/ # (Optional) For static files like CSS, JS, images
✅ Predicts Car Price (USD) and Car Price (INR) ✅ User-friendly Bootstrap-based Interface ✅ Persistent trained model using Joblib (no retraining on every request) ✅ Production-ready Flask app structure
The car.csv
contains synthetic or real-world data with the following columns:
Fuel Type | Engine Type | Engine Size | Horsepower | Price (USD) |
---|---|---|---|---|
0 / 1 | 0 / 1 | float | float | float |
Fuel Type
: 0 = Petrol, 1 = DieselEngine Type
: 0 = Manual, 1 = Automatic
git clone https://github.com/lovnishverma/Car-Price-Prediction.git
cd Car-Price-Prediction
pip install -r requirements.txt
python app.py
Visit http://localhost:5000
For production deployments, use Gunicorn:
gunicorn -w 4 -b 0.0.0.0:5000 app:app
Or deploy on Render / Railway / Huggingface using this requirements.txt
.
Input Field | Sample Value |
---|---|
Fuel Type | 0 |
Engine Type | 1 |
Engine Size | 1.6 |
Horsepower | 120 |
Output: Predicted Price (USD): $18,000 Predicted Price (INR): ₹1,47,6720
Flask==3.0.3
pandas==2.2.2
scikit-learn==1.5.0
joblib==1.4.2
This project is open-source under the MIT License.
Lovnish Verma Portfolio Website GitHub