Skip to content

mtalha4t7/evRangePrediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚗 EV Range Predictor - Using Machine Learning

📌 Overview

This project is an EV Range Predictor that estimates the driving range of an electric vehicle (EV) based on key parameters such as acceleration, top speed, battery capacity, and drive type. The model is trained using machine learning techniques to provide accurate range predictions.

📊 Dataset

The dataset used for training the model contains information on various electric vehicles, including:

  • Acceleration (0-100 km/h)
  • Top Speed
  • Battery Capacity (kWh)
  • Seats
  • Drive Type (FWD, RWD, AWD)
  • Weather Condition (MILD, COLD, HOT,RAINY)
  • Road Type (CITY, Highway, Mixed,Mountain)
  • Range (km) - Target Variable

✅ Core Prediction System

Predicts EV range based on battery capacity, acceleration, top speed, seats, and drive type

Model trained using real-world EV data (RandomForestRegressor with preprocessing pipeline)

🆕 Advanced Environmental Factors

Weather Conditions Integration: Select from Mild (default), Cold, Hot, or Rainy weather

Road Type Analysis: Choose between City, Highway, Mixed, or Mountain roads

Dynamic impact calculation for both weather (+15% to -20% range effect) and road conditions

🆕 Modern Interactive UI

Glassmorphism design with animated elements

Real-time slider inputs with visual feedback

Custom toggle switches for weather/road options

Responsive layout for all devices

🆕 Enhanced Results Dashboard

Predicted range display with large typography

Weather Impact (% change from baseline)

Road Impact (% change from baseline)

Energy Efficiency (kWh/km calculation)

Animated loading spinner during predictions

🆕 User Experience Improvements

Live input validation

Hover/focus states for all interactive elements

SVG icons integrated into buttons

Error handling with friendly messages

✅ Backend Ready

Flask API endpoint for predictions

ColumnTransformer for mixed data types (numeric + categorical)

OneHotEncoder for drive type (FWD/RWD/AWD)

StandardScaler for numerical features

Prediction Result

⚙️ How to Run

  1. Install Dependencies:
    pip install -r requirements.txt
  2. Run the Application:
    python app.py
  3. Open in Browser:
    http://127.0.0.1:5000/
    

🔥 Model Training

The machine learning model is trained using regression techniques on the EV dataset. The trained model is saved as model.pkl and is used for predictions in the Flask application.

📁 Project Structure

📂 EV-Range-Predictor
│── 📁 templates     # HTML files
│── 📄 app.py        # Flask application
│── 📄 model.ipynb   # Jupyter notebook for model training
│── 📄 model.pkl     # Trained machine learning model
│── 📄 evdataset.csv  # Dataset used for training
│── 📄 requirements.txt  # Dependencies
│── 📄 README.md      # Project documentation

About

calculating the range of Electric vehicle

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published