Skip to content

Repository files navigation

🚗 ZimAuto: End-to-End Car Valuation & Negotiation Engine

Live Application: Try the Interactive Valuation Dashboard

📌 Project Overview

The secondary vehicle market in Zimbabwe often suffers from price opacity and significant valuation asymmetry. This project implements an end-to-end machine learning pipeline that extracts live marketplace listings, trains a non-linear pricing model, and serves an interactive web interface designed to assist buyers in identifying fair market values and arbitrage opportunities.


🛠️ Tech Stack & Methodology

  • Data Acquisition & Engineering: Scraped 600+ pages across local automobile classifieds using BeautifulSoup and Requests. Standardized 3,000+ unstructured records, engineered vehicle lifespan metrics (e.g., Annual_Mileage), and segmented vehicles into distinct pricing clusters.
  • Predictive Modeling: Trained an XGBoost Regressor using a target Log-Transformation ($y = \log(1 + \text{Price})$) to eliminate overvaluation on budget vehicles.
  • Hyperparameter Tuning: Applied Optuna across 60 trials with 5-fold cross-validation to optimize learning rates, tree depth, and L1/L2 regularization terms.
  • Deployment & User Experience: Developed a interactive Gradio interface featuring dynamic cascading dropdowns (Make $\rightarrow$ Model filtering), real-time pricing inference, system trust confidence profiles, and negotiation floor/ceiling bounds.

📊 Key Results & Performance

  • Variance Explained ($R^2$): 0.790 (~79% of cross-market price variance explained).
  • Mean Absolute Error (MAE): ~$5,112 USD baseline error across all market tiers.
  • Statistical Governance: Integrated a residual Z-score filter ($\pm3\sigma$) to automatically flag data entry errors and extreme structural damage risks.

📂 Repository Structure

├── data/                       # Raw and processed datasets
│   └── unified_zimbabwe_car_market.csv
├── models/                     # Serialized model and encoder binaries
│   ├── zimauto_xgb_log_model.pkl
│   └── le_*.pkl
├── notebooks/                  # EDA, Feature Engineering, & Training scripts
├── app.py                      # Main Gradio deployment script
├── requirements.txt            # Environment dependencies
└── README.md                   # Project documentation