Skip to content

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.

License

Notifications You must be signed in to change notification settings

lovnishverma/Car-Price-Prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚗 Car Price Prediction using Flask and Decision Tree Regressor

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.


🔧 Technologies Used

  • Python 3
  • Flask (Web Framework)
  • Pandas (Data Handling)
  • Scikit-learn (ML Model)
  • Joblib (Model Persistence)
  • Bootstrap 5 (Frontend Styling)

📂 Project Structure

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

🚀 Features

✅ 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


📊 Dataset (car.csv)

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 = Diesel
  • Engine Type: 0 = Manual, 1 = Automatic

🔥 Running Locally

1️⃣ Clone Repository

git clone https://github.com/lovnishverma/Car-Price-Prediction.git
cd Car-Price-Prediction

2️⃣ Install Dependencies

pip install -r requirements.txt

3️⃣ Run the Application

python app.py

Visit http://localhost:5000


🏭 Running in Production

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.


💡 Example Usage

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


🌐 Live Demo

View on Render


📥 Requirements

Flask==3.0.3
pandas==2.2.2
scikit-learn==1.5.0
joblib==1.4.2

📄 License

This project is open-source under the MIT License.


✨ Author

Lovnish Verma Portfolio Website GitHub


About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

  •  

Packages

No packages published