Yokutjon Tohirova
Back to projects

Government Internship Project

Electricity Consumption Modeling

Large-Scale Energy Usage Analysis in R

A large-scale data-analysis and baseline-modeling project completed during a summer internship at the Digital Ministry of the Republic of Uzbekistan. The project examined electricity usage patterns and prepared a reproducible foundation for future energy-demand forecasting.

Electricity Consumption ModelingGovernment Internship Project
Illustrative overview of the electricity-consumption analysis workflow

~10M

Raw meter-reading records consolidated

427,900

Monthly consumer observations prepared for modeling

3 years

Historical electricity-consumption data analyzed

Objective

Building a foundation for future energy forecasting

The project began with electricity meter readings, confirmed payment records, and monthly account-balance files. The primary analytical target was monthly electricity consumption.

The immediate objective was to organize the historical data, understand usage patterns, create a modeling-ready dataset, and evaluate an interpretable regression baseline before developing more advanced forecasting methods.

Analytical workflow

From raw meter readings to temporal model evaluation

01

Data consolidation

Combined ten reading files into one time-ordered dataset and standardized consumer identifiers, dates, and meter values.

02

Consumption calculation

Converted cumulative meter readings into actual consumption by calculating the difference between consecutive readings for each consumer.

03

Monthly aggregation

Aggregated daily readings into consumer-level monthly consumption records to support trend analysis and forecasting.

04

Exploratory analysis

Examined seasonality, yearly distributions, individual consumer patterns, concentration of high-use consumers, and possible outliers.

05

Feature engineering

Created seasonal flags, prior-month consumption, consumption change, log-transformed usage, and high-usage indicators.

06

Temporal modeling

Trained a linear-regression baseline using 2022–2023 data and evaluated it on the 2024 observation period.

Temporal validation

Testing the model on a later time period

Training period

2022–2023

279,278 monthly observations

Testing period

2024

148,622 monthly observations

Key findings

Seasonality, skewed usage, and consumer heterogeneity

01

Overall monthly electricity consumption showed recurring seasonal variation and a modest upward trend.

02

Consumption tended to increase during colder months, supporting the inclusion of seasonal features.

03

Daily-consumption values were strongly right-skewed, with a relatively small number of very high-use consumers.

04

Consumer behavior varied substantially, and several extreme values required additional investigation.

05

The baseline model captured broad patterns but produced substantial relative error for low-use and irregular consumers.

Baseline evaluation

Measuring prediction error on 2024 data

MAE

6,590.74 kWh

RMSE

10,020.15 kWh

MAPE

63.62%

The MAPE remained high, indicating that predictions were less reliable for consumers with very low usage, irregular behavior, or extreme observations.

Modeling lesson

Evaluating features as carefully as model performance

The baseline model helped expose several issues that would need to be addressed before production forecasting, including outliers, zero-consumption records, missing lag values, and differences between household and high-use consumers.

One engineered variable, average daily consumption, was derived directly from monthly total consumption. Because the monthly total was also the prediction target, this created target leakage and made the apparent model fit overly optimistic.

A stronger next iteration would remove target-derived predictors, use only information available before the forecast period, segment different consumer types, and compare time-series or tree-based models using rolling temporal validation.

Technology

Tools used for data preparation, analysis, and modeling

Rtidyversedplyrlubridateggplot2Linear RegressionFeature EngineeringTemporal Validation