Power Plus is a Flask web app that forecasts hourly electricity demand for six Delhi regions using a lightweight ensemble (XGBoost, LightGBM, Ridge). It pulls hourly weather from Open-Meteo and falls back to seasonal synthetic data if the API is unavailable.
- 24-hour demand forecasts per selected region
- Ensemble predictions with a confidence score
- Weather-driven inputs with automatic fallback data
- Forecast plot generation saved to static/predicted_demand_plot.png
- JSON API for single-region predictions
app.py Flask entry point
app/ Optional blueprint-based app (not used by app.py)
data/ Cleaned input datasets
saved_models/ Trained model artifacts (xgb, lgb, ridge)
templates/ HTML templates
static/ Images and generated plots
utils/ Predictor, weather, and plotting utilities
- Install dependencies:
pip install -r requirements.txt
- Run the app:
python app.py
- Open: http://localhost:5000
- Forecast UI: http://localhost:5000/forecast
- Demo login (optional): username
user, passwordpassword - Map view: http://localhost:5000/map
POST http://localhost:5000/api/predict
Request body:
{
"date": "2026-01-15",
"region": "DELHI",
"hour": 12,
"temperature": 28.0,
"humidity": 60.0,
"wind_speed": 2.5
}Response:
{
"success": true,
"prediction": {
"ensemble": 3125.42,
"xgb": 3150.12,
"lgb": 3104.55,
"ridge": 3008.77,
"confidence": 0.94
}
}- Models are loaded from saved_models/. If any model files are missing, the app will fail to start.
- Weather data uses the Open-Meteo API and requires no API key.
- Update the
SECRET_KEYin app.py before any real deployment.
- Suraj Mishra: iamsuraj187104@gmail.com
- GitHub: https://github.com/suraj187104/power-plus