A machine learning-powered web application that predicts average monthly household electricity consumption for districts in Karnataka, India, based on real government data and user inputs.
Karnataka's electricity consumption has evolved over the years due to urbanization, lifestyle changes, and home expansions. This app predicts future household electricity needs using key variables like:
- Future Year (up to 2035)
- Household Size
- District
- Area of the house (in sq. ft)
- Help households and consultants plan energy usage
- Provide data-driven insights to policymakers
- Raise awareness about growing power demands
Layer | Tech |
---|---|
ML Model | scikit-learn , pandas , numpy |
Backend | Flask , Python |
Frontend | HTML , CSS , JavaScript |
Deployment | Render (Cloud Hosting) |
The model was trained on historical data from 1990 onwards using:
- Feature scaling for numeric inputs
- One-hot encoding for categorical districts
- Linear regression / Random Forest for consumption prediction
- Saved using
joblib
for real-time prediction in Flask
karnataka-electricity-consumption-predictor/
├── static/ # Static assets (images, CSS)
├── templates/ # HTML templates for web pages
│ ├── index.html
│ ├── model.html
│ ├── result.html
│ └── ...
├── app.py # Flask server logic
├── model.py # ML model pipeline
├── requirements.txt # Python dependencies
├── Procfile # Render deployment file
├── README.md # Project overview
└── LICENSE # MIT License
- Clone the repo
git clone https://github.com/yourusername/karnataka-electricity-consumption-predictor.git
cd karnataka-electricity-consumption-predictor
- Create and activate virtual environment
python -m venv venv
# Activate:
source venv/bin/activate # On Mac/Linux
venv\Scripts\activate # On Windows
- Install dependencies
pip install -r requirements.txt
- Run the app
python app.py
- Visit in browser
http://127.0.0.1:5000/
Try it here:
electricityconsumptionpredictor.onrender.com
No sign-in needed — just input your details and get your monthly prediction!
- Data visualization for predicted trends (graphs, heatmaps)
- Export to CSV or PDF for reports
- Personalized energy-saving recommendations
This project is licensed under the MIT License.
Feel free to use, modify, and build upon it.
- Government of Karnataka energy data sources
- scikit-learn & Flask open-source community
- Render.com for free deployment support
Disha S Basti