<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.3 20210610//EN" "https://jats.nlm.nih.gov/publishing/1.3/JATS-journalpublishing1-3.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:ali="http://www.niso.org/schemas/ali/1.0/" article-type="research-article" dtd-version="1.3" xml:lang="en">
<front>
<journal-meta>
<journal-id journal-id-type="publisher-id">JETIR</journal-id>
<journal-title-group><journal-title>Journal of Emerging Technologies and Innovative Research</journal-title><abbrev-journal-title abbrev-type="publisher">JETIR</abbrev-journal-title></journal-title-group>
<issn publication-format="electronic">2349-5162</issn>
<publisher><publisher-name>JETIR Publication</publisher-name></publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="publisher-id">JETIR2611299</article-id>
<article-categories><subj-group subj-group-type="heading"><subject>Research Article</subject></subj-group><subj-group subj-group-type="discipline"><subject>Engineering</subject></subj-group></article-categories>
<title-group><article-title>ENERGY CONSUMPTION PATTERNS ANALYSIS Prediction and 24-Hour Forecasting Using Machine Learning</article-title></title-group>
<contrib-group>
<contrib contrib-type="author"><name><surname>T</surname><given-names>Priyanka</given-names></name><xref ref-type="aff" rid="aff1"/></contrib>
<contrib contrib-type="author"><name><surname>Aman</surname><given-names>Faiz</given-names><prefix>Mr.</prefix></name><xref ref-type="aff" rid="aff1"/></contrib>
<contrib contrib-type="author"><name><surname>A</surname><given-names>Anusha</given-names></name><xref ref-type="aff" rid="aff1"/></contrib>
<contrib contrib-type="author"><name><surname>DR</surname><given-names>Deepika</given-names></name><xref ref-type="aff" rid="aff1"/></contrib>
</contrib-group>
<aff id="aff1">Bahubali college of Engineering Shravanabelagola</aff>
<pub-date publication-format="electronic" date-type="pub"><day>30</day><month>11</month><year>2026</year></pub-date>
<volume>13</volume>
<issue>11</issue>
<fpage>c805</fpage>
<lpage>c809</lpage>
<permissions><copyright-statement>© 2026 The Author(s)</copyright-statement><copyright-year>2026</copyright-year><copyright-holder>The Author(s)</copyright-holder><license license-type="open-access" xlink:href="https://creativecommons.org/licenses/by/4.0/"><ali:license_ref>https://creativecommons.org/licenses/by/4.0/</ali:license_ref><license-p>This is an open access article distributed under the terms of the Creative Commons Attribution 4.0 International License (CC BY 4.0).</license-p></license></permissions>
<self-uri content-type="pdf" xlink:href="https://jetir.org/papers/JETIR2611299.pdf"/>
<self-uri content-type="html" xlink:href="https://jetir.org/fulltext.php?paper=JETIR2611299"/>
<abstract><p>Electricity consumption changes with the hour of the day, the day of the week, the season and the weather, which makes manual analysis and planning of energy use difficult. This paper presents a machine-learning system that analyses hourly electricity consumption together with temperature and humidity in order to identify usage patterns and peak hours and to predict future consumption. A dataset of 17,544 hourly records (January 2023 to December 2024) is cleaned and enriched with time-based, indicator, lag and rolling-average features. Exploratory data analysis brings out clear hourly, monthly, weekly and seasonal patterns, and shows that the previous-day (0.92) and previous-hour (0.83) consumption have the strongest correlation with current consumption. Linear Regression, Decision Tree and Random Forest models are compared on a chronological 80:20 split. Random Forest performs best, with an MAE of 13.5727 kWh, an RMSE of 18.3017 kWh and an R² score of 0.9385. The saved model and scaler are used in a Python web application that predicts the consumption in kWh, classifies it as low, moderate or high, and generates a 24-hour forecast. The dataset used in this work is generated sample data, so the results demonstrate the method and do not describe a real installation.</p></abstract>
<kwd-group kwd-group-type="author"><kwd>Energy consumption</kwd><kwd>Load forecasting</kwd><kwd>Random Forest</kwd><kwd>Machine learning</kwd><kwd>Feature engineering</kwd><kwd>Exploratory data analysis.</kwd></kwd-group>
<counts><fig-count count="6"/><table-count count="2"/><equation-count count="3"/><ref-count count="10"/><word-count count="2142"/></counts>
</article-meta>
</front>
<body>
<sec id="s-i-introduction"><title>I. INTRODUCTION</title>
<p>Electricity is one of the most essential resources in modern society and is used in homes, offices, industries and educational institutions. The demand for electrical energy keeps increasing because of population growth, urbanization, industrial development and the wider use of electrical appliances. Understanding and managing electricity consumption has therefore become important for improving energy efficiency and reducing unnecessary use.</p>
<p>Consumption does not remain constant. It rises in the morning and evening hours when lighting, fans, air conditioners and other appliances are in use, falls during the night, differs between weekdays and weekends, and changes with the season. Temperature, humidity, the time of day, the day of the week and the season are the main factors involved. Traditional analysis based on manually checking historical records becomes difficult when the data contains a large number of hourly readings, and repeated patterns, peak periods and relations between factors are easily missed. Automated data analysis and machine learning are well suited to this task.</p>
<p>This paper presents <italic>Energy Consumption Patterns Analysis</italic>, a Python-based system that studies hourly electricity consumption, identifies usage patterns and predicts future requirements. The objectives are: (i) to clean the data and prepare time-based, lag and rolling-average features; (ii) to find usage patterns, peak hours and trends; (iii) to build and compare Linear Regression, Decision Tree and Random Forest models; (iv) to predict consumption and generate a 24-hour forecast; and (v) to present the analysis, prediction and forecast through a web application. Real-time smart-meter data collection and energy-wastage detection are outside the scope of the present work.</p>
</sec>
<sec id="s-ii-literature-review"><title>II. LITERATURE REVIEW</title>
<p>Several studies relate energy consumption to weather and historical load. Qiao <italic>et al. </italic>[1] predicted building energy consumption from meteorological data such as temperature and humidity using Decision Tree, Support Vector Machine, Random Forest and voting regression, and stressed the importance of feature selection and of comparing algorithms. Smith <italic>et al. </italic>[2] forecast short-term residential load from smart-meter data using customer segmentation, feature extraction and neural networks, and reported an improvement of up to 12% in hourly one-day forecasting in this work-in-progress study. Li <italic>et al. </italic>[3] grouped load records with K- means clustering, using weighted meteorological factors and historical load, and used Random Forest to select a forecasting model for each condition; the approach gave lower MAE, RMSE and MAPE than the individual models. Chahbi <italic>et al. </italic>[4] applied machine learning to energy prediction in industrial buildings in the stee l industry and used permutation feature importance to make the model easier to interpret.</p>
<p>Deep-learning and time-series methods have also been widely applied. Nutakki <italic>et al. </italic>[5] used LSTM and Deep Neural Network models for a seven-day forecast in a home energy management system, and Abraham <italic>et al. </italic>[6] compared LSTM and CNN models on fourteen years of hourly data from an open-source Kaggle dataset. Koduru <italic>et al. </italic>[7] reviewed ARIMA, SARIMA, Uni-LSTM and Multi-LSTM models together with anomaly detection for household consumption, and found Multi-LSTM to perform best. Dang <italic>et al. </italic>[8] compared Random Forest, XGBoost, LSTM and GRU for appliance-level hour-ahead and day-ahead forecasting, Ahmed <italic>et al. </italic>[9] compared LSTM and XGBoost on one year of per -minute household data, and Pradeep <italic>et al. </italic>[10] evaluated LSTM, BiLSTM, GRU and BiGRU on ten years of university -campus data, where a historical window of six observations performed better in most of the tested combinations.</p>
<p>The surveyed work shows that previous consumption and weather information are valuable inputs and that Random Forest is a strong candidate for energy prediction. However, deep-learning models may need large amounts of data, longer training time and more computing resources, and some existing systems give only a prediction without detailed pattern analysis or a simple user interface. The present work uses lightweight machine-learning models with lag features and combines data visualisation, prediction and a 24-hour forecast in a single web application.</p>
</sec>
<sec id="s-iii-proposed-methodology"><title>III. PROPOSED METHODOLOGY</title>
<p>The system works in eight stages: data collection, preprocessing, feature extraction, exploratory data analysis (EDA), model training, prediction, 24-hour forecasting and presentation through a web application. The overall flow is shown in Fig. 1. The models are trained once offline, and the saved model and scaler are then loaded by the application for every prediction request.</p>
<fig id="f1" position="anchor"><label>Figure 1</label><caption><p>Fig. 1. Flowchart of the proposed system</p></caption><graphic xlink:href="https://jetir.org/html/JETIR2611299-f1.jpg"/></fig>
<sec id="s-a-dataset"><title>A. Dataset</title>
<p>The input is a CSV file (energy.csv) of 17,544 hourly records from January 2023 to December 2024. Each record holds the date and time, the electricity consumption in kWh (consumption_kwh), the temperature in °C and the humidity in %. The dataset contains generated sample values and does not represent live smart-meter readings.</p>
</sec>
<sec id="s-b-data-preprocessing"><title>B. Data Preprocessing</title>
<p>The datetime column is converted to the date-time type and the records are arranged in chronological order. Duplicate rows are removed, and missing consumption values are filled with the average consumption of the same hour of the day.</p>
</sec>
<sec id="s-c-feature-engineering"><title>C. Feature Engineering</title>
<p>Three groups of features are derived. <italic>Time features </italic>are the hour, day of the week, month, year, quarter, week and day. <italic>Indicator features </italic>mark weekends and peak hours. <italic>Previous-usage features </italic>are the consumption one hour earlier (lag_1h), the consumption 24 hours earlier (lag_24h) and the rolling mean of the last 24 hours (rolling_mean_24h). The first 24 rows have no previous-usage values and are dropped, which leaves 17,520 records for modelling.</p>
</sec>
<sec id="s-d-data-splitting-and-scaling"><title>D. Data Splitting and Scaling</title>
<p>Because the data is a time series, it is split chronologically without shuffling into 80% training and 20% testing data. A StandardScaler is fitted on the training features only and then applied to both the training and the test features.</p>
</sec>
<sec id="s-e-machine-learning-models"><title>E. Machine-Learning Models</title>
<p>Three regression models are trained on the scaled training data. <italic>Linear Regression </italic>is used as a simple baseline. <italic>Decision Tree </italic>learns a set of rules that split the data on the input features. <italic>Random Forest </italic>combines many decision trees, which helps it capture non-linear relations between the features and the consumption.</p>
</sec>
<sec id="s-f-evaluation-metrics"><title>F. Evaluation Metrics</title>
<p>The models are compared on the test data using the Mean Absolute Error (MAE), the Root Mean Squared Error (RMSE) and the R² score, where <italic>y</italic><sub>i </sub>is the actual consumption, <italic>ŷ</italic><sub>i </sub>the predicted consumption, <italic>ȳ </italic>the mean of the actual values and <italic>n </italic>the number of test records:</p>
<disp-formula><preformat>MAE = (1/n) ∑i=1n | yi − ŷi | (1)</preformat></disp-formula>
<disp-formula><preformat>RMSE = √[(1/n) ∑i=1n (yi − ŷi)2 ] (2)</preformat></disp-formula>
<disp-formula><preformat>R2 = 1 − [∑i=1n (yi − ŷi)2 ] / [∑i=1n (yi − ȳ)2 ] (3)</preformat></disp-formula>
</sec>
<sec id="s-g-prediction-forecast-and-web-application"><title>G. Prediction, Forecast and Web Application</title>
<p>The best model and its scaler are saved with Joblib (energy_model.pkl and scaler.pkl) and loaded once when the application starts. For a prediction, the user enters the temperature, humidity, hour, day of the week, month and the previous -hour and previous-day consumption; each value is checked against its allowed range (for example, the temperature must be between −10 and 50 °C). The remaining features are derived from the inputs, scaled, and passed to the model, and the predicted consumption in kWh is classified as low, moderate or high, together with a peak or off -peak status. For the 24-hour forecast, the next 24 hourly time stamps are created with assumed temperature and humidity values; each hourly prediction is used as the previous-hour value for the next hour, and the total, maximum, minimum and average values are calculated.</p>
<p>The system is implemented in Python on Windows using Pandas and NumPy for data handling, Scikit-learn for the models, Matplotlib and Seaborn for the charts, and the built-in http.server module for the web application. An Intel Core i3/i5 or higher processor with at least 4 GB of RAM (8 GB recommended) is sufficient to run it.</p>
</sec>
</sec>
<sec id="s-iv-results-and-discussion"><title>IV. RESULTS AND DISCUSSION</title>
<sec id="s-a-exploratory-data-analysis"><title>A. Exploratory Data Analysis</title>
<p>The hourly pattern is shown in Fig. 2. The highest average consumption occurs at 19:00 (381.40 kWh) and the lowest at 01:00 (220.37 kWh), with higher usage in the morning and evening periods and lower usage late at night and in the early morning.</p>
<fig id="f2" position="anchor"><label>Figure 2</label><caption><p>Fig. 2. Average consumption for each hour of the day</p></caption><graphic xlink:href="https://jetir.org/html/JETIR2611299-f2.jpg"/></fig>
<p>Fig. 3 shows the monthly pattern. June has the highest monthly average (365.26 kWh) and November the lowest (250.22 kWh). Across the days of the week, weekend consumption is higher than weekday consumption in this dataset: Sunday records the highest average (323.57 kWh) and Wednesday the lowest (292.00 kWh).</p>
<fig id="f3" position="anchor"><label>Figure 3</label><caption><p>Fig. 3. Average consumption for each month</p></caption><graphic xlink:href="https://jetir.org/html/JETIR2611299-f3.png"/></fig>
<p>The seasonal comparison in Fig. 4 shows the highest average consumption in summer (36 3.33 kWh), followed by winter (330.96 kWh) and autumn (253.56 kWh). The higher summer consumption may be associated with the use of cooling appliances such as fans and air conditioners. The main findings are summarised in Table I.</p>
<fig id="f4" position="anchor"><label>Figure 4</label><caption><p>Fig. 4. Distribution of consumption in each season</p></caption><graphic xlink:href="https://jetir.org/html/JETIR2611299-f4.png"/></fig>
<table-wrap id="t1" position="anchor"><label>Table 1</label><caption><p>Table I. Summary of the consumption patterns found in the data</p></caption><table frame="hsides" rules="groups"><thead><tr><th><bold>Pattern </bold></th><th><bold>Highest average </bold></th><th><bold>Lowest average </bold></th></tr></thead><tbody><tr><td>Hour of the day</td><td>19:00 (381.40 kWh)</td><td>01:00 (220.37 kWh)</td></tr><tr><td>Month</td><td>June (365.26 kWh)</td><td>November (250.22 kWh)</td></tr><tr><td>Day of the week</td><td>Sunday (323.57 kWh)</td><td>Wednesday (292.00 kWh)</td></tr><tr><td>Season</td><td>Summer (363.33 kWh)</td><td>Autumn (253.56 kWh)</td></tr></tbody></table></table-wrap>
<p>The relation between temperature and consumption is weak, with a correlation of about 0.14, so temperature alone cannot explain the changes in consumption and is used together with the other features. The correlation heatmap in Fig. 5 shows that previous usage is much more strongly related to current consumption: lag_24h has a correlation of 0.92, lag_1h 0.83 and rolling_mean_24h 0.62. This supports the use of the lag and rolling-mean features in the models.</p>
<fig id="f5" position="anchor"><label>Figure 5</label><caption><p>Fig. 5. Correlation heatmap of the numerical features</p></caption><graphic xlink:href="https://jetir.org/html/JETIR2611299-f5.jpg"/></fig>
</sec>
<sec id="s-b-model-performance"><title>B. Model Performance</title>
<p>Table II gives the MAE, RMSE and R² score of the three models on the test data. Random Forest is the best model: it has the lowest MAE and RMSE and the highest R² score (0.9385), with the Decision Tree close behind. Linear Regression has a negative R² score (−2.1523), which means that on the test data it fits worse than simply predicting the mean consumption, so a linear model is not suitable for this data.</p>
<table-wrap id="t2" position="anchor"><label>Table 2</label><caption><p>Table II. Performance of the models on the test data</p></caption><table frame="hsides" rules="groups"><thead><tr><th><bold>Model </bold></th><th><bold>MAE (kWh) </bold></th><th><bold>RMSE (kWh) </bold></th><th><bold>R² score </bold></th></tr></thead><tbody><tr><td>Linear Regression</td><td>32.9517</td><td>131.0470</td><td>−2.1523</td></tr><tr><td>Decision Tree</td><td>14.5977</td><td>20.1892</td><td>0.9252</td></tr><tr><td><bold>Random Forest </bold></td><td><bold>13.5727 </bold></td><td><bold>18.3017 </bold></td><td><bold>0.9385 </bold></td></tr></tbody></table></table-wrap>
</sec>
<sec id="s-c-application-output-and-24-hour-forecast"><title>C. Application Output and 24-Hour Forecast</title>
<p>For a sample input, the application predicts a consumption of 243.66 kWh, which is classified as moderate consumption, and also shows whether the selected hour is a peak or off-peak hour and whether the day is a weekday or weekend. The 24-hour forecast screen (Fig. 6) gives a total forecast consumption of 8226.70 kWh, a maximum of 409.40 kWh at 20:00, a minimum of 294.60 kWh at 11:00 and an average of 342.80 kWh, with the hourly values shown as a bar chart and in a table.</p>
<fig id="f6" position="anchor"><label>Figure 6</label><caption><p>Fig. 6. 24-hour forecast generated by the web application</p></caption><graphic xlink:href="https://jetir.org/html/JETIR2611299-f6.jpg"/></fig>
</sec>
<sec id="s-d-system-testing"><title>D. System Testing</title>
<p>Twelve test cases were run: six functional and six non-functional. They covered dataset loading, duplicate and missing-value handling, feature generation, model training and evaluation, model loading and prediction, invalid-input handling, processing of the full dataset, response time for prediction and forecast, repeatability of results, stability under repeated use, and display in a web browser. All twelve test cases passed.</p>
</sec>
<sec id="s-e-limitations"><title>E. Limitations</title>
<p>The dataset contains generated sample values, so the patterns found, such as higher weekend consumption, describe this dataset and may not hold for an actual household or building. The models were evaluated on a single chronological split, and the 24-hour forecast uses assumed temperature and humidity values.</p>
</sec>
</sec>
<sec id="s-v-conclusion-and-future-scope"><title>V. CONCLUSION AND FUTURE SCOPE</title>
<p>A system for analysing and predicting electricity consumption was developed and tested. The hourly data was cleaned and extended with time, lag and rolling-average features, and the exploratory analysis brought out the hourly, weekly, monthly and seasonal patterns and the peak hours. Among Linear Regression, Decision Tree and Random Forest, Random Forest performed best (R² = 0.9385, MAE = 13.5727 kWh, RMSE = 18.3017 kWh). A Python web application uses th e saved model to predict consumption, classify it as low, moderate or high, and generate a 24-hour forecast on an ordinary computer.</p>
<p>In future work, the system can be connected to smart meters and IoT devices for real-time monitoring, use a weather API for live temperature and humidity, and be extended with models such as LSTM and XGBoost. Explainable-AI techniques such as SHAP, a mobile application, energy-saving recommendations and an alert system for consumption above a set limit are also planned.</p>
</sec>
<sec id="s-acknowledgment"><title>ACKNOWLEDGMENT</title>
<p>The authors thank Mrs. Sowmyashree S M (project co-ordinator), Mrs. Shylaja L N (Head of the Department of Artificial Intelligence and Machine Learning) and Dr. Sunil Kumar D (Principal), Bahubali College of Engineering, Shravanabelagola, for their support during this work.</p>
</sec>
</body>
<back><ref-list><title>REFERENCES</title>
<ref id="r1"><label>1</label><mixed-citation>Q. Qiao, A. Yunusa-Kaltungo and R. Edwards, “Predicting building energy consumption based on meteorological data,” in <italic>Proc. 2020 </italic> <italic>IEEE PES/IAS PowerAfrica Conf.</italic>, Nairobi, Kenya, 2020, pp. 1–5.</mixed-citation></ref>
<ref id="r2"><label>2</label><mixed-citation>D. Smith, K. Jaskie, J. Cadigan, J. Marvin and A. Spanias, “Machine learning for fast short-term energy load forecasting,” in <italic>Proc. 2020 </italic> <italic>IEEE Conf. on Industrial Cyberphysical Systems (ICPS)</italic>, Tampere, Finland, 2020, pp. 433–436.</mixed-citation></ref>
<ref id="r3"><label>3</label><mixed-citation>Z. Li, J. Zhang, W. Jing, Z. Lu, W. Zheng and X. Wen, “A short-term load forecasting method via model selection based on random forest,” 2022.</mixed-citation></ref>
<ref id="r4"><label>4</label><mixed-citation>I. Chahbi, N. Ben Rabah and I. Ben Tekaya, “Towards an efficient and interpretable machine learning approach for energy prediction in industrial buildings: A case study in the steel industry,” in <italic>Proc. AICCSA</italic>, 2022.</mixed-citation></ref>
<ref id="r5"><label>5</label><mixed-citation>M. Nutakki, M. Subashini and S. Mandava, “Energy consumption forecasting in home energy management system using deep learning techniques,” 2022.</mixed-citation></ref>
<ref id="r6"><label>6</label><mixed-citation>A. V. Abraham, P. Sasidharan, S. J. S. Tejas, M. S. Manohara, R. Muthu and R. C. Naidu, “Predicting energy consumption using LSTM and CNN deep learning algorithm,” 2022.</mixed-citation></ref>
<ref id="r7"><label>7</label><mixed-citation>S. S. Koduru, V. S. P. Machina and S. Madichetty, “A review on forecasting models and anomaly detection for hous ehold energy consumption,” 2022.</mixed-citation></ref>
<ref id="r8"><label>8</label><mixed-citation>H.-A. Dang, M. Guenana, V. B. Dinh, T. Neu and D. Guyomarc’h, “Deep learning and ensemble learning models for individual appliance level short-term load forecasting in buildings,” 2023.</mixed-citation></ref>
<ref id="r9"><label>9</label><mixed-citation>F. Ahmed, A. Arshad and A. U. Rehman, “Comparative analysis of time series forecasting of a household load consumption with LSTM neural networks and XGBoost model,” 2024.</mixed-citation></ref>
<ref id="r10"><label>10</label><mixed-citation>B. Pradeep, P. Kulkarni, F. Ullah and A. Lakas, “Energy use and demand prediction using time-series deep learning forecasting techniques: Application for a university campus,” <italic>IEEE Open J. Comput. Soc.</italic>, vol. 6, pp. 189–198, 2025.</mixed-citation></ref>
</ref-list></back>
</article>
