Skip to content

mdsaad31/car-price-predictor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš— Car Price Prediction System

Python Flask Scikit-Learn Bootstrap License GitHub Stars

🌟 Features

πŸš€ Accurate Predictions

πŸ“Š 30+ Brands

πŸ’» Interactive UI

πŸ“± Responsive

⚑ Real-time

πŸ” Detailed Analysis

πŸ› οΈ Tech Stack

Backend

Python Flask Pandas NumPy Scikit-Learn

Frontend

HTML5 CSS3 JavaScript Bootstrap

ML Models

Random Forest Gradient Boosting

πŸš€ Quick Start

Clone repository

git clone https://github.com/yourusername/car-price-predictor.git
cd car-price-predictor

Create virtual environment

python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate

Install dependencies

pip install -r requirements.txt

Run application

python app.py

Access at: http://localhost:5000

πŸ“Š Model Performance

Metric Score
RΒ² Score 0.92
Mean Error β‚Ή12,500
Training Time 45 seconds
Best Model Random Forest (n_estimators=200)

🌐 API Endpoints

Python:

import requests

data = {
    "company": "Hyundai",
    "name": "Grand i10",
    "year": 2018,
    "kms_driven": 35000,
    "fuel_type": "Petrol"
}

response = requests.post("http://localhost:5000/predict", data=data)
print(response.json())```

Javascript:

fetch('/predict', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/x-www-form-urlencoded',
  },
  body: new URLSearchParams({
    company: 'Hyundai',
    name: 'Grand i10',
    year: 2018,
    kms_driven: 35000,
    fuel_type: 'Petrol'
  })
})
.then(response => response.json())
.then(data => console.log(data));

Response

Successful Response:

{
  "success": true,
  "predicted_price": "β‚Ή425,000",
  "confidence": 0.92,
  "model": "Random Forest"
}

Error Response:

{
  "success": false,
  "error": "Brand must be one of: Maruti, Hyundai, Honda, ..."
}

Error Handling

Common error responses include:

  • 400 Bad Request - Missing required parameters
  • 422 Unprocessable Entity - Invalid input values
  • 500 Internal Server Error - Server-side issues

Always check the success flag in the response before processing results.

πŸš™ Supported Brands

Maruti Hyundai Toyota Honda Tata Mahindra BMW Volkswagen
And more ...

🀝 How to Contribute

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

Releases

No releases published

Packages

No packages published