Smart Electricity Consumption
A household energy prediction system that turns appliance usage and household behavior into consumption forecasts, bill estimates, peak-usage alerts, and actionable savings recommendations.
A complete ML lifecycle built around a self-created, physically consistent household energy dataset and a Flask prediction interface.

A bill tells you what you used. The system should help explain what to change.
The project focuses on household daily electricity consumption and converts appliance usage, household characteristics, seasonality and outdoor temperature into a prediction that can be acted on before the next bill arrives.
From raw household inputs to a reproducible prediction pipeline.
The dataset is explicitly documented as self-created synthetic data rather than a public Kaggle/UCI dataset. The pipeline handles missing values, duplicates, IQR-based outlier winsorization, categorical encoding and feature scaling before model training.
Features were designed around household behavior, not just raw appliance hours.
Aggregates usage from the appliances with the largest consumption impact.
Captures the combined effect of cooling demand and environmental conditions.
Normalizes household consumption against family size.
Encodes the behavioral difference between working days and weekends.
Adds a household-size/space relationship to the model input.
Seven regression algorithms were evaluated before selecting the production model.
| Model | R² | MAE | Status |
|---|---|---|---|
| Linear Regression | 0.9641 | 1.57 kWh | Best |
| Ridge Regression | — | — | Compared |
| Decision Tree | — | — | Compared |
| Random Forest | — | — | Compared |
| Gradient Boosting | — | — | Compared |
| XGBoost | — | — | Compared |
| SVR | — | — | Compared |
The repository documents Linear Regression as the best-performing model with R² 0.9641, MAE 1.57 kWh, RMSE 1.98 kWh, and 5-fold cross-validation R² of 0.9624 ± 0.0072. The full comparison remains available in the repository's model-performance report.
The model is exposed as a household-facing decision tool, not just a notebook.
Predicts household daily electricity usage from the supplied household and appliance inputs.
Converts the prediction into an estimated monthly usage and bill view.
Generates personalized energy-saving suggestions and estimates potential savings.
Flags expected peak-usage hours to make high-demand behavior visible.
Returns an energy-efficiency score on a 0–100 scale.
Includes consolidated Excel reporting for model performance, features and business insights.
Interpretability and realistic assumptions mattered as much as the score.
The dataset was self-created with physically consistent relationships instead of pure random noise, including AC usage behavior tied to temperature and season.
Linear Regression became the selected model despite more complex alternatives being tested, keeping the household-facing prediction layer easier to reason about.
Billing is implemented as a tiered/blended approximation rather than hardcoding one country's tariff table.
The current system is a solid ML application, with clear paths toward production data.
Future work includes automatically filling outdoor temperature from a live weather API.
SHAP-based per-prediction explanations are planned for deeper model transparency.
Sub-hourly or time-series smart-meter ingestion would improve peak-hour detection and realism.
Docker packaging and hyperparameter optimization are listed as future improvements.
The implementation layer.
The complete analysis, reports and application live in the repository.
The repository includes the executed ML notebook, trained model artifacts, evaluation reports, feature importance, visuals, documentation and Flask application.