A Machine Learning-powered Streamlit web application that predicts the electric vehicle (EV) driving range based on parameters such as battery capacity, efficiency, top speed, acceleration, and price.
The app includes interactive data visualizations, feature importance analysis, and dynamic plots showing the relationship between each feature and the predicted range.
This project combines Machine Learning (Regression) with an interactive Streamlit dashboard.
It helps users understand how key EV features influence the predicted driving range, while also allowing real-time input and visualization updates.
- Frontend/UI: Streamlit + Plotly
- Backend: Python (Scikit-learn, Pandas, NumPy)
- Model Type: Regression (e.g., Linear Regression, Random Forest, etc.)
- Visualization: Plotly for interactive charts
- Deployment: Streamlit Cloud / Hugging Face Spaces / Render
✅ Predicts EV driving range (in km) based on input features
✅ Dynamic feature impact visualization using feature importance
✅ Interactive scatter plots showing relationships between features and range
✅ Real-time dropdown feature selection for detailed insights
✅ Fully responsive UI with dark mode visuals
✅ Clean and modular code structure
The dataset includes EV specifications and performance metrics such as:
| Feature | Description |
|---|---|
Battery Capacity (kWh) |
Total battery capacity |
Efficiency (Wh/km) |
Power consumption per kilometer |
Top Speed (km/h) |
Maximum achievable speed |
Accel (0-100s) |
Time taken to reach 100 km/h |
Price (€) |
Approximate price in euros |
Range (km) |
Target variable representing real-world range |
- Data Preprocessing: Handle missing values, scaling, encoding
- Model Training: Fit regression model (e.g., Random Forest, Linear Regression)
- Evaluation: Calculate metrics like R², RMSE
- Visualization: Feature importance and correlation plots
- Prediction: Generate output from user inputs in Streamlit
git clone https://github.com/<your-username>/EV-Range-Predictor.git
cd EV-Range-PredictorMake sure you have Python 3.8+ installed. Then run:
pip install -r requirements.txtstreamlit run app.pyOnce the app is running, open it in your browser at:
http://localhost:8501
- Go to Streamlit Cloud
- Click "New app"
- Connect your GitHub repository
- Configure the following:
- Repository:
02Tirtha/EV-Range-Predictor - Branch:
main - Main file path:
app.py
- Repository:
- Click Deploy 🚀
🔋 Estimated EV Range: 410.57 km
- Scatter plot with a smooth trendline (green for positive, red for negative correlation).
- "Your EV" marker highlights the predicted value.
- Interactive dropdown lets you explore how each feature affects range.
| File | Description |
|---|---|
app.py |
Main Streamlit app file |
ev_range_pipeline.pkl |
Pre-trained ML pipeline |
ElectricCarData_Clean.csv |
Dataset used for training (optional) |
requirements.txt |
Python dependencies |
README.md |
Project documentation |
Contributions are welcome!
If you'd like to improve this project:
- Fork the repository
- Create a new branch (
feature-improvement) - Commit your changes
- Submit a pull request 🚀
Please ensure your code follows good practices and is well-documented.
Try the EV Range Predictor app online:
https://ev-range-predictor.streamlit.app/
Tirtha Jhaveri
💡Passionate about Machine Learning, Full Stack, and Adaptive Web Design.
📧 tjhaveri99@gmail.com
- Add more EV brands and models dynamically
- Support multiple ML model comparisons
- Deploy with custom domain & branding
- Add CO₂ savings and battery degradation estimation
This project is open for educational and personal use.

