Skip to content

MelkiMeriem/CarPrediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Car Price Prediction - Clean Project

A clean, production-ready version of the Car Price Prediction application. This project predicts vehicle prices for the Tunisian market using a trained Extra Trees machine learning model.

Quick Start

Prerequisites

  • Python 3.11+
  • Node.js 16+

Installation

  1. Install Python dependencies:
pip install -r requirements.txt
  1. Install frontend dependencies:
cd frontend
npm install

Running the Application

Terminal 1 - Start Backend:

python app.py

Backend runs on http://localhost:5000

Terminal 2 - Start Frontend:

cd frontend
npm run dev

Frontend runs on http://localhost:5173

Project Structure

Car-Prediction-Project-Clean/
├── app.py                 # Flask API server
├── predictor.py           # ML prediction module
├── requirements.txt       # Python dependencies
├── models/
│   ├── extra_trees_tuned.pkl  # Trained model
│   └── encoders.pkl           # Preprocessing encoders
└── frontend/
    ├── src/
    │   ├── App.jsx
    │   ├── main.jsx
    │   ├── styles.css
    │   └── components/
    │       ├── PredictionForm.jsx
    │       └── Results.jsx
    ├── index.html
    ├── package.json
    └── vite.config.js

API Endpoints

  • GET /health - Health check
  • GET /api/brands - Get supported brands
  • POST /api/predict - Predict price for a single vehicle
  • POST /api/predict_batch - Batch prediction

Usage Example

from predictor import CarPricePredictor

predictor = CarPricePredictor()
result = predictor.predict(
    marque='BMW',
    modele='Série 3',
    annee=2021,
    kilometrage=45000,
    energie='Diesel',
    boite_vitesses='Automatique',
    puissance_fiscale=9
)
print(f"Estimated price: {result['prix_predit']:,.0f} DT")

License

Educational and research purposes.

CarPrediction

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages