Electric Vehicle Price Prediction

Repository

End-to-end supervised ML pipeline to predict EV prices in Germany from technical specs.

Dataset

The dataset contains electric vehicle specifications and pricing information for the German market, including battery capacity, driving range, efficiency, and performance-related features.

Target variable: Price in Germany

Tools & Technologies

PythonPandasNumPyScikit-learnMatplotlibSeabornJupyter Notebook

Overview

This project implements an end-to-end supervised machine learning pipeline to predict electric vehicle prices in Germany based on technical and performance specifications. The goal is to demonstrate the full data science workflow from raw data to an optimized predictive model.

Problem Statement

Accurately predicting electric vehicle prices is important for both consumers and industry stakeholders. This project explores how vehicle specifications such as range, battery capacity, efficiency, and performance can be used to estimate market prices using machine learning.

Methodology

The project follows a structured machine learning pipeline:

  • Exploratory Data Analysis (EDA)
  • Data cleaning and preprocessing
  • Feature engineering
  • Feature scaling
  • Train-test split
  • Model comparison
  • Hyperparameter tuning
  • Model evaluation and final selection

Exploratory Data Analysis (EDA)

Exploratory Data Analysis

Models Evaluated

  • K-Nearest Neighbors (KNN)
  • Decision Tree
  • Gradient Boosting

After model comparison and tuning, KNN achieved the best performance.

Results

Best Model
KNN
Optimized K-Nearest Neighbors
Test Accuracy
~94%
Best Performance
Parameter
n_neighbors = 3
Optimized Hyperparameter

Key Takeaways

  • Proper preprocessing and feature scaling significantly impact model performance.
  • Simple models like KNN can outperform more complex ones when well-tuned.
  • Vehicle technical specifications provide strong signals for price prediction.

Future Improvements

  • Testing additional regression models
  • Incorporating market demand or sales data
  • Extending the analysis to other European markets