Back to selected work
Machine Learning / Energy Optimization

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.

Project snapshot
Forecast → explain → optimize

A complete ML lifecycle built around a self-created, physically consistent household energy dataset and a Flask prediction interface.

0.9641
R² score
1.57 kWh
MAE
1.98 kWh
RMSE
07
Models compared
Smart Electricity Consumption project preview
01 / The problem

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.

02 / Dataset & pipeline

From raw household inputs to a reproducible prediction pipeline.

600 records
14 input features
Preprocess
IQR · encoding · scaling
Feature engineer
5 derived features
Compare
7 regressors
Serve
Flask prediction app

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.

03 / Feature engineering

Features were designed around household behavior, not just raw appliance hours.

High_Power_Appliance_Hours

Aggregates usage from the appliances with the largest consumption impact.

Cooling_Load_Index

Captures the combined effect of cooling demand and environmental conditions.

Consumption_Per_Member

Normalizes household consumption against family size.

Is_Weekend

Encodes the behavioral difference between working days and weekends.

Rooms_Per_Member

Adds a household-size/space relationship to the model input.

04 / Model comparison

Seven regression algorithms were evaluated before selecting the production model.

ModelR²MAEStatus
Linear Regression0.96411.57 kWhBest
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.

05 / Prediction product

The model is exposed as a household-facing decision tool, not just a notebook.

Daily consumption

Predicts household daily electricity usage from the supplied household and appliance inputs.

Monthly estimate

Converts the prediction into an estimated monthly usage and bill view.

Recommendations

Generates personalized energy-saving suggestions and estimates potential savings.

Peak usage

Flags expected peak-usage hours to make high-demand behavior visible.

Efficiency score

Returns an energy-efficiency score on a 0–100 scale.

Reports

Includes consolidated Excel reporting for model performance, features and business insights.

06 / Engineering decisions

Interpretability and realistic assumptions mattered as much as the score.

Synthetic, but structured

The dataset was self-created with physically consistent relationships instead of pure random noise, including AC usage behavior tied to temperature and season.

Interpretability

Linear Regression became the selected model despite more complex alternatives being tested, keeping the household-facing prediction layer easier to reason about.

Tariff-aware design

Billing is implemented as a tiered/blended approximation rather than hardcoding one country's tariff table.

07 / Limitations & next steps

The current system is a solid ML application, with clear paths toward production data.

Live weather

Future work includes automatically filling outdoor temperature from a live weather API.

Explainable predictions

SHAP-based per-prediction explanations are planned for deeper model transparency.

Real smart-meter data

Sub-hourly or time-series smart-meter ingestion would improve peak-hour detection and realism.

Deployment hardening

Docker packaging and hyperparameter optimization are listed as future improvements.

08 / Tech stack

The implementation layer.

PythonPandasNumPyScikit-learnXGBoostMatplotlibSeabornFlaskJupyteropenpyxl
Project evidence

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.