It is crucial for energy managers and utilities to have reliable electricity consumption predictions and demand-side management. Proposed System is a paper that combines Linear Regression and Random Forest Regression for Effective Energy Consumption Prediction. The past electricity consumption data, including environmental and temporal parameters, are incorporated. utilized The proposed system comprises the following pre-preprocessing. Staging references various tasks to model training Application (Abnormality detection, and Electricity bill prediction. MAE, Running MAPE and RMSE Is. The results of the experiment. Show your Random Forest gives better performance than Linear. Nonlinear consumption pattern can lead to regression. On the other hand, the Linear Regression model is more interpretable. Can become a good benchmark for comparison. Can be used for residential and commercial and industrial management.
Introduction
The widespread adoption of smart meters in homes and businesses has generated large volumes of electricity consumption data, creating new opportunities for accurate energy demand forecasting. Reliable load prediction is essential for efficient power grid management, demand-side planning, and preventing issues such as high operational costs, resource wastage, grid instability, and blackouts. Since electricity demand is influenced by factors such as weather, time, and user behavior, traditional statistical models often struggle to capture complex nonlinear relationships. Machine learning techniques address these limitations by learning patterns directly from historical data.
This study proposes a machine learning-based electricity demand forecasting framework using Linear Regression (LR) and Random Forest Regression (RFR) models. The system utilizes four years of hourly smart-meter data (2011–2014) containing electricity consumption, temperature, humidity, and calendar-related information. Advanced feature engineering techniques, including lag variables, moving averages, moving standard deviations, and cyclic time encoding, were applied to improve prediction accuracy.
The data underwent preprocessing steps such as handling missing values through interpolation, outlier removal, and Min-Max normalization. The dataset was divided into training (70%), validation (15%), and testing (15%) sets. Linear Regression was used as a baseline model to identify key demand relationships, while Random Forest Regression provided nonlinear modeling capabilities and reduced overfitting through ensemble learning.
The system architecture also includes an intelligent consumer dashboard featuring:
Seven-day electricity demand forecasting
Peak-load alerts
Anomaly detection using Isolation Forest
Electricity bill estimation
Smart appliance scheduling during off-peak hours
Historical consumption comparison
The literature review highlights recent advancements in energy forecasting, including reinforcement learning, Support Vector Regression, CNN-LSTM hybrid models, ensemble methods, clustering techniques, and anomaly detection systems. These studies demonstrate the benefits of combining machine learning with feature engineering and adaptive forecasting techniques.
Experimental results show that Random Forest Regression significantly outperformed Linear Regression:
Metric
Linear Regression
Random Forest
MAE
0.065
0.042
RMSE
0.089
0.067
MAPE
5.21%
3.48%
R²
0.91
0.96
The Random Forest model reduced forecasting error by approximately 33% and achieved a higher prediction accuracy, indicating the presence of strong nonlinear patterns in electricity consumption data.
Feature importance analysis revealed that:
24-hour and 168-hour lag features contributed 41% of total importance.
Temperature accounted for 17%.
Daily cyclic time features contributed 12%.
Results also showed that feature engineering played a critical role in performance improvement, as removing lag and rolling statistical features significantly increased prediction errors.
Conclusion
The current study proposes an approach for modeling household electricity consumption using both linear regression and random forest regression models. An important goal in the approach is to develop an interpretable model while maintaining the ability to consider non-linear interactions. Feature engineering is an essential part of the approach involving such features as multi-resolution lags, rolling window aggregation, periodic feature extraction, and including weather data. In particular, this leads to a model with a coefficient of determination (R^2) of 0.96 and a mean absolute percentage error (MAPE) of 3.48% for the test sample of one-hour observations.
Also, a visualization dashboard is suggested, providing various decision-making aids for predicting the consumption of electricity, warning about the peak-load, detecting anomalies, estimating bills, and scheduling appliances. Taking into account all the above aspects, the suggested approach can be applied to household electricity consumption forecasting and optimization. Possible improvements might include weather predictions with an API, occupation predictions with IoT-sensors, online learning, and hybrid modeling incorporating LSTMs and forests.
References
[1] P. Duffy et al., \"Energy sources and supply grids—The growing need for storage,\" Royal Society of Chemistry, 2018, pp. 1–41.
[2] S. S. Pappas et al., \"Electricity demand load forecasting of the Hellenic power system using an ARMA model,\" Electr. Power Syst. Res., vol. 80, no. 3, pp. 256–264, Mar. 2010.
[3] B. Hojjati, \"Global energy consumption driven by more electricity in residential and commercial buildings,\" U.S. Energy Inf. Admin., Tech. Rep. 38, 2019.
[4] Y. Zhang, J. Chen, and X. Wang, \"A contextual reinforcement learning approach for electricity consumption forecasting in buildings,\" IEEE Trans. Smart Grid, vol. 13, no. 4, pp. 3110–3121, 2022.
[5] W. Liu, X. Xu, and M. Zhao, \"A multi-scale electricity consumption prediction algorithm based on time-frequency variational autoencoder,\" IEEE Access, vol. 10, pp. 45821–45834, 2022.
[6] L. Botman et al., \"A scalable ensemble approach to forecast the electricity consumption of households,\" IEEE Trans. Smart Grid, vol. 14, no. 1, pp. 502–515, Jan. 2023.
[7] J. Wang and X. Li, \"Abnormal electricity detection of users based on improved Canopy-Kmeans and isolation forest algorithms,\" IEEE Trans. Smart Grid, vol. 13, no. 6, pp. 4917–4929, Nov. 2022.
[8] X. Qian et al., \"Assessing the impact of the COVID-19 pandemic on electricity consumption: A machine learning approach,\" Energy Rep., vol. 8, pp. 7504–7516, 2022.