How niranjanzoro/smart-energy-prediction works
Smart Energy Consumption Predictor is a Flask-backed household energy forecasting dashboard. Users view hourly history, request forecasts up to 72 hours ahead, inspect prediction intervals and model metrics, and submit series for anomaly detection or saving suggestions. Model preparation, Ridge/LSTM training, evaluation and multi-step back-testing form a separate supporting workflow. The README and excerpts establish the main paths; unsampled API routes and UI wiring are represented only where documentation or shown calls support them.
Main entry points: app.py Flask API · train_models.py Training workflow · app.js Web dashboard · forecaster.py Recursive forecaster
Components 14
Dashboard
- Web dashboard
frontend/static/js/app.js - Dashboard page
frontend/templates/index.html
Forecasting API
- Flask API
backend/app.py - Hourly history
data/processed_energy.csv - Saved models and metadata
models/saved
Data And Models
- Data preparation
models/data_loader.py - Ridge model
models/linear_model.py - Stacked LSTM
models/lstm_model.py - Recursive forecaster
models/forecaster.py - Training workflow
scripts/train_models.py - Model metrics
models/metrics.py
Energy Insights
- Anomaly detection
models/anomaly_detector.py - Saving suggestions
models/anomaly_detector.py
Other components
- Dashboard user
Connections 17
- Dashboard user → Web dashboard: uses
README.md - Web dashboard → Dashboard page: renders
- Web dashboard → Flask API: requests data
frontend/static/js/app.js - Flask API → Hourly history: reads history
README.md - Flask API → Saved models and metadata: loads models
README.md - Flask API → Ridge model: loads model
backend/app.py - Flask API → Stacked LSTM: loads model
backend/app.py - Flask API → Recursive forecaster: requests forecast
backend/app.py - Flask API → Anomaly detection: detects anomalies
backend/app.py - Flask API → Saving suggestions: generates tips
README.md - Training workflow → Data preparation: prepares data
scripts/train_models.py - Training workflow → Ridge model: trains and saves
scripts/train_models.py - Training workflow → Stacked LSTM: trains and saves
scripts/train_models.py - Training workflow → Recursive forecaster: back-tests
scripts/train_models.py - Training workflow → Model metrics: evaluates predictions
scripts/train_models.py - Training workflow → Saved models and metadata: writes artifacts
README.md - Recursive forecaster → Data preparation: builds features
models/forecaster.py