A machine learning-powered web app that predicts electric vehicle (EV) sales in Indian states based on user input features.
This dynamic web application predicts electric vehicle (EV) sales trends using a custom-trained machine learning model. Users can upload new datasets, train or retrain models directly from the dashboard, and explore powerful insights through interactive visualizations and downloadable reports. Built for analysts, policy makers, and auto manufacturers to decode the future of EV markets—state by state, type by type, and over time.
- Dashboard :
- Prediction Page :
Here’s a sample output :
- Dynamic Dropdowns auto-filled from dataset (vehicle types, classes, brands, etc.)
- Light/Dark Mode switch for better accessibility and modern feel
- Real-time graph updates post prediction or training
- Upload your own CSV to retrain the model from the dashboard
-
Inputs:
- Vehicle Type
- Brand/Model
- State
- Year
-
Uses a trained model to predict EV sales volume
Graphs include:
- EV Sales by State
- EV Sales Trends over Years
- Vehicle Type Distribution
- Brand-wise Sales Share (Future)
- Correlation Matrix (Future)
- Custom graphs rendered from user selection (Future)
- Train new models using uploaded .csv via the dashboard
- Upload new training data directly
- Train model on-the-fly with one click
- Models saved as .pkl files for future predictions
- Downloadable report with:
- Prediction result
- Embedded analysis graphs
- Copyright
Layer | Tech |
---|---|
Backend | Python, Flask |
ML/Processing | scikit-learn, pandas, NumPy |
Text Features | TF-IDF Vectorization |
Visualization | matplotlib, seaborn |
Frontend | HTML, CSS, JavaScript (custom styles) |
ELECTRIC_VEHICLE_SALES/
│
├── app.py
├── train_model.py
├── extract_dropdown_data.py
├── graphs.py
├── requirements.txt
│
├── data/
│ └── EV_sales_india.csv
│
├── model/
│ ├── model.pkl
│ ├── features.pkl
│ └── dropdown_data.pkl
│
├── static/
│ ├── styles.css
│ ├── graphs.css
│ └── graphs/
│ └── *.png
│
├── templates/
│ ├── index.html
│ ├── result.html
│ └── dashboard.html
│
└── README.md
-
Install dependencies:
pip install -r requirements.txt
-
Create these folders and files:
create model folder create model.pkl , features.pkl & dropdown_data.pkl keep all .pkl files empty (req to save trained models)
-
Train the model (Optional):
python train_model.py
-
Run the Flask app:
python app.py
-
Open browser at:
http://localhost:5000
- Open the app in browser
- Select vehicle, state, year, etc.
- Click Predict
- View results and interactive charts
- Head to Dashboard tab to:
- Upload new data
- Retrain model
- Refresh dropdowns
Made with ❤️ by Aditya Arora
© 2025 Aditya Arora. All rights reserved.