π XGBoost-basierte Fahrzeugpreis-Vorhersage mit Flask Web-Interface
- Generated with ChatGPT+ GPT-Codex-5.2 and VS Code Plugin
- Refined with Google Colab built-in Gemini3 AI
Live Demo auf Render (ca. 2 Minuten Startzeit)
Dieses Projekt implementiert ein Machine Learning Modell zur Vorhersage von Gebrauchtwagenpreisen basierend auf verschiedenen Fahrzeugeigenschaften wie:
- Marke & Modell (Brand, Model)
- Fahrzeugalter (Vehicle Age)
- Kilometerstand (km driven)
- Kraftstofftyp (Fuel Type: Benzin, Diesel, etc.)
- Getriebeart (Transmission: Manuell, Automatik)
- Motorleistung (Engine, Max Power)
- Verbrauch (Mileage)
- SitzplΓ€tze (Seats)
| Komponente | Technologie |
|---|---|
| ML-Modell | XGBoost Regressor |
| Web-Framework | Flask |
| Frontend | Jinja2 Templates, WTForms |
| Datenverarbeitung | Pandas, NumPy, Scikit-learn |
| Visualisierung | Matplotlib, Seaborn |
- Python 3.11+
- pip oder uv (empfohlen)
# Repository klonen
git clone https://github.com/your-username/regression-xgboost.git
cd regression-xgboost
# Virtuelle Umgebung erstellen
python -m venv .venv
# Umgebung aktivieren
source .venv/bin/activate # macOS/Linux
# oder
.venv\Scripts\activate # Windows
# AbhΓ€ngigkeiten installieren (mit uv - schneller)
pip install uv
uv pip install -r requirements.txt
# ODER klassisch mit pip
pip install -r requirements.txt
# Flask-App starten
export FLASK_APP=app.py # macOS/Linux
# set FLASK_APP=app.py # Windows
flask run --reloadDie App ist dann erreichbar unter: http://127.0.0.1:5000
# gunicorn local standard port 8000 on render 5000 port open on production
gunicorn -w 4 -b 0.0.0.0:5000 app:app regression-xgboost/
βββ app.py # Flask Web-Anwendung
βββ requirements.txt # Python-AbhΓ€ngigkeiten
βββ models/
β βββ xgboost_price_model.json # Trainiertes XGBoost-Modell
βββ templates/
β βββ base.html # Basis-Template
β βββ index.html # Hauptseite mit Formular
βββ training/
β βββ Cars.ipynb # Jupyter Notebook fΓΌr Training
β βββ Cars.py # Python-Skript fΓΌr Training
β βββ Price_Prediction.csv # Rohdaten
β βββ PricePredictionCleanedUp.csv # Bereinigte Daten
β βββ SPEC.md # Training-Spezifikation
βββ legacy/ # Γltere Spezifikationen
Das Modell kann mit dem Jupyter Notebook oder Python-Skript neu trainiert werden:
cd training
jupyter notebook Cars.ipynbcd training
python Cars.pyDas Modell wird mit folgenden Regressionsmetriken evaluiert:
- MAE (Mean Absolute Error)
- RMSE (Root Mean Squared Error)
- RΒ² (BestimmtheitsmaΓ)
| Variable | Beschreibung | Standard |
|---|---|---|
FLASK_APP |
Flask-Anwendung | app.py |
CSV_PATH |
Pfad zur CSV-Datei | training/PricePredictionCleanedUp.csv |
MODEL_PATH |
Pfad zum Modell | models/xgboost_price_model.json |
- FEATURE_ENGINEERING.md - Feature Engineering Pipeline
- FLASK_SERVER.md - Flask Server Details
- XG_REGRESSION.md - XGBoost Regression Details
- GOOGLE_COLAB.md - Google Colab Anleitung
- REQUIREMENTS.md - Anforderungen
MIT License