Skip to content

Repository files navigation

🚗 EV Remaining Range Prediction - Machine Learning Model

An end-to-end Machine Learning model trained on Project_Final_Dataset_CarID_Updated.xlsx that predicts an Electric Vehicle's (EV) remaining driving range in kilometers based on:

  1. Manufacturer (Brand) & Model (with catalog lookup of battery capacity in kWh)
  2. Current State of Charge / Battery Level (%)

📁 Project Structure

ML_EV/
├── Project_Final_Dataset_CarID_Updated.xlsx # Official EV Fleet Dataset (10,000 trips across 50 models)
├── EV_Range_Prediction_Model.ipynb          # Jupyter Notebook (EDA, data1 schema, ML modeling, evaluation)
├── train_model.py                           # Python ML training & export script
├── predict.py                               # CLI & Python inference utility
├── ev_range_model.pkl                       # Serialized trained model & vehicle catalog package
├── requirements.txt                         # Python dependencies
└── README.md                                # Project documentation

⚡ Quick Start

1. Run Inference / Predictions

Predict remaining range via command line:

# Predict for a specific brand and model
python predict.py --brand Tata --model "Punch EV" --battery 75

# List all supported EV manufacturers
python predict.py --list-brands

# List all models for a manufacturer
python predict.py --list-models Tata

2. Python Code Integration

import pickle

# Load the trained ML model package
with open("ev_range_model.pkl", "rb") as f:
    model_payload = pickle.load(f)

pipeline = model_payload["pipeline"]

# Run inference directly
# (Pass a DataFrame matching the data1 feature columns)

3. Re-train the Model

To re-train on Project_Final_Dataset_CarID_Updated.xlsx and export a fresh .pkl:

python train_model.py

4. Interactive Jupyter Notebook

Open and explore EV_Range_Prediction_Model.ipynb in VS Code / Antigravity using the Python 3.14.6 kernel.


📊 Feature Schema (data1)

Column Description Type
Range Remaining Driving Range in km Target ($y$)
Battery Level (%) Current battery percentage Feature ($X_1$)
Make Vehicle Manufacturer Feature ($X_2$)
Acceleration 0 - 100 km/h 0-100 km/h time (s) Feature ($X_3$)
Top Speed Top speed (km/h) Feature ($X_4$)
ER Full Electric Range (km) Feature ($X_5$)
Total Power Motor power (kW) Feature ($X_6$)
Total Torque Motor torque (Nm) Feature ($X_7$)
Drive Driver behaviour style Feature ($X_8$)
BC Battery capacity (kWh) Feature ($X_9$)
Length, Width, Height, Wheelbase Vehicle dimensions (mm) Features ($X_{10\dots13}$)
Gross Vehicle Weight (GVWR) Vehicle weight (kg) Feature ($X_{14}$)
Max. Payload Maximum payload capacity (kg) Feature ($X_{15}$)
Cargo Volume Cargo space (L) Feature ($X_{16}$)

📈 Model Performance

Model Algorithm $R^2$ Score MAE (km) RMSE (km)
Gradient Boosting Regressor 0.8960 23.25 km 29.93 km
Random Forest Regressor 0.8794 24.31 km 32.24 km
XGBoost Regressor 0.8751 24.71 km 32.81 km
Linear Regression 0.8593 27.61 km 34.82 km

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages