Next Article in Journal
Preface of the 2024 10th International Conference on Advanced Engineering and Technology
Previous Article in Journal
Unveiling Bottled Water Perils: Investigating Phthalate Ester Acid Leaching from Bottled Water in Qatar’s Scorching Climes
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Proceeding Paper

Analysis and Selection of Multiple Machine Learning Methodologies in PyCaret for Monthly Electricity Consumption Demand Forecasting †

by
José Orlando Quintana Quispe
,
Alberto Cristobal Flores Quispe
,
Nilton Cesar León Calvo
and
Osmar Cuentas Toledo
*
Research Group in Civil Engineering, School of Civil Engineering, National University of Moquegua, Moquegua 18001, Peru
*
Author to whom correspondence should be addressed.
Presented at the 2024 10th International Conference on Advanced Engineering and Technology, Incheon, Republic of Korea, 17–19 May 2024.
Mater. Proc. 2024, 18(1), 5; https://doi.org/10.3390/materproc2024018005
Published: 28 August 2024
(This article belongs to the Proceedings of 10th International Conference on Advanced Engineering and Technology)

Abstract

:
This study investigates the application of several machine learning models using PyCaret to forecast the monthly demand for electricity consumption; we analyze historical data of monthly consumption readings for the Cuajone Mining Unit of the company Minera Southern Peru Copper Corporation, recorded in the electricity yearbooks from the decentralized office of the Ministry of Energy and Mines in the Moquegua region between 2008 and 2018. We evaluated the performance of 27 machine learning models available in PyCaret for the forecast of monthly electricity consumption, selecting the three most effective models: Exponential Smoothing, AdaBoost with Conditional Deseasonalize and Detrending and ETS (Error-Trend-Seasonality). We evaluated the performance of these models using eight metrics: MASE, RMSSE, MAE, RMSE, MAPE, SMAPE, R2, and calculation time. Among the analyzed models, Exponential Smoothing demonstrated the best performance with a MASE of 0.8359, an MAE of 4012.24 and an RMSE of 5922.63; among the analyzed models, Exponential Smoothing demonstrated the best performance with a MASE of 0.8359, an MAE of 4012.24 and a RMSE of 5922.63, followed by AdaBoost with Conditional Deseasonalize and Detrending, while ETS also provided competitive results. Forecasts for 2018 were compared with actual data, confirming the high accuracy of these models. These findings provide a robust energy management and planning framework, highlighting the potential of machine learning methodologies to optimize electricity consumption forecasting.

1. Introduction

Predicting has always been fascinating; Thales of Miletus predicted an eclipse on 28 May 585 BC.
Since the invention of the electric light bulb in the 19th century, electric energy has been introduced into home lighting [1]. As a strategic and valuable resource, electric energy decisively determines the functioning of a chain of economic variables that influence a region’s economy and, therefore, a country. In the case of strategic companies in the country’s regions, it constitutes a convenient and valuable resource to make predictions about, as this would allow for more precise and efficient management [2].
The data from the research in this area are at the regional level. Due to this issue, it is possible to make projections regarding this valuable resource, which is becoming increasingly necessary to manage efficiently.
Electricity consumption forecasting has been the subject of extensive research, with numerous models and methodologies developed over the years. Traditional statistical methods, such as Exponential Smoothing and ARIMA, have been widely used for their simplicity and effectiveness in capturing linear patterns in time series data [3]. However, with the advent of machine learning, more sophisticated models have emerged, offering the potential to capture complex, non-linear relationships in the data.
Numerous machine learning models have been used to predict electricity consumption in recent years, each with advantages and disadvantages. For example, decision trees and random forests have received praise for their interpretability and robustness [4], while neural networks and support vector machines are known for their ability to handle large amounts of data and capture complex patterns [5].
PyCaret, an open source and low-code Python-based machine learning library, offers a variety of tools to automate machine learning workflows [6], such as Random Forest [7], Gradient Boosting [8], Light Gradient Boosting [9], Polynomial Trend Forecaster [10], Extreme Gradient Boosting [11], Theta Forecaster, ARIMA [12], Seasonal Naive Forecaster [13], Lasso Least Angular Regressor [14], Decision Tree with Conditional Deseasonalize and Detrending [15], Extra Trees Regressor [16], Gradient Boosting Regressor [17], Random Forest Regressor [18], Light Gradient Boosting Machine [19] Naive Forecaster [20], Croston [21], Auto ARIMA [22], and Bayesian Ridge [23]. By leveraging PyCaret, this study aims to systematically evaluate and compare 27 different machine learning models for forecasting monthly electricity consumption. We assess the models using eight evaluation metrics: MASE, RMSSE, MAE, RMSE, MAPE, SMAPE, R2, and computation time (TT) [6,24,25].
PyCaret offers a wide variety of machine-learning modules, such as regression, classification, anomaly detection, clustering, and natural language processing, allowing us to perform many machine learning tasks. PyCaret presents 27 machine learning models for the treatment of time series, and below is a detailed description of each method, including its creator, along with relevant bibliographic references, which can be seen in Table 1.
The objectives of this research are:
  • To evaluate the performance of 27 machine learning models available in PyCaret for forecasting monthly electricity consumption.
  • To identify the three most effective models based on a comprehensive analysis of eight evaluation metrics.

2. Materials and Methods

2.1. Study Area

The study was carried out in the Mariscal Nieto province of the department of Moquegua, using information from the electrical yearbooks from 2008 to 2018 on the monthly electrical energy consumption of the Cuajone Mining Unit of the mining and metallurgical company Southern Peru Copper Corporación de Energía y Minas of the Moquegua Region.
The Southern Copper Corporation (México Group) remains active in adding larger volumes of copper to national production, supporting Peru’s path to becoming the world’s leading producer, due to the growing demand for copper in support of the energy transition towards renewable sources [46]. The location of the mining company Southern Peru Copper Corporation can be seen in Figure 1.

2.2. Methodology

We used the software Python 3.11.7 | packaged by Anaconda, Inc. based in Austin, TX, United States (main, 15 December 2023, 18:05:47) [MSC v.1916 64 bit (AMD64)] on win32 and PyCaret 3.3.2. This is a powerful tool for processing and forecasting time series through its libraries, available in the Repository (CRAN).
The study utilizes monthly electricity consumption data from the Southern Peru Copper Corporation from 2008 to 2017. We used the data for 2018 for validation and comparison with forecasted values. The methodology involves the following steps and workflow of methodology in PyCaret, as seen in Figure 2:
3.
Data Collection: We extracted historical monthly electricity consumption data from electrical yearbooks.
4.
Data Preprocessing: We handled missing values and normalized the data. We also applied seasonal decomposition to understand underlying patterns.
5.
Feature Engineering: We created lag features and rolling statistics to capture temporal dependencies.
6.
Model Selection: Various models were selected, including Exponential Smoothing, Adaptive Boosting with Conditional Deseasonalization and Detrending, and ETS.
7.
Model Training and Tuning: We trained the models using PyCaret and tuned the hyperparameters using GridSearchCV.
8.
Evaluation Metrics: Models were evaluated based on MASE, RMSSE, MAE, RMSE, MAPE, SMAPE, R2, and computation time.
PyCaret’s variety of features makes the model selection processes easier. These functions are initialization, model comparison, instruction, analysis model, and evaluation model. The Setup () function in PyCaret allows you to direct the preprocessing and ML workflow. This involves entering the dataset and the slope or target variable, which must be carried out before.
PyCaret trains multiple models based on performance metrics and ranks them from best to worst. The compare_models() function ranks models based on their metrics and also considers the time this process takes, which varies depending on the size and type of data file. The plot_model() function is included in PyCaret, allowing visualization of the capacity of trained machine learning models.

2.2.1. Data

The scope of the study includes the monthly consumption readings recorded in the electricity yearbooks of the decentralized office of the Ministry of Energy and Mines in the Moquegua region between 2008 and 2018, in megawatt-hours (MWh) [47].

2.2.2. Application of Metrics

The metrics that allow the analysis and selection of the best model are:
1. 
Mean Absolute Scaled Error (MASE):
MASE is a measure of forecast accuracy that scales the mean absolute error based on the in-sample absolute mean mistake from a naïve forecast method (usually the previous period value). It is particularly useful for comparing forecast accuracy across different data scales.
MASE =   1 n t = 1 n y t y ^ t 1 n 1 t = 2 n y t y t 1
where y t is the actual value, y ^ t is the forecasted value, and n is the number of observations.
2. 
Root Mean Squared Scaled Error (RMSSE):
RMSSE is similar to MASE but uses squared errors instead of absolute errors. It measures the average magnitude of the forecast errors, penalizing more significant errors more heavily.
RMSSE =   1 n t = 1 n y t y ^ t 2 1 n 1 t = 2 n y t y t 1 2
3. 
Mean Absolute Error (MAE):
MAE measures the average magnitude of the errors in a set of forecasts without considering their direction. It is the average of absolute differences between forecasted and actual observations over the test sample.
MAE = 1 n t = 1 n y t y ^ t
4. 
Root Mean Squared Error (RMSE):
RMSE measures the square root of the average of the squared differences between forecasted and actual values. Compared to MAE, it is more sensitive to large errors.
RMSE =   1 n t = 1 n ( y t y ^ t ) 2
5. 
Mean Absolute Percentage Error (MAPE):
MAPE expresses forecast accuracy as a percentage. It is the average of the absolute percentage errors of forecasts. It is scale-independent but can be biased if actual values are minimal.
MAPE   = 1 n t = 1 n y t y ^ t y t × 100 %
6. 
Symmetric Mean Absolute Percentage Error (SMAPE):
SMAPE is an alternative to MAPE that symmetrically treats over- and under-forecasts. It is more robust when dealing with low actual values.
S M A P E = 1 n i = 1 n y i y ^ i y i + y ^ i 2 × 100 %
7. 
R2 Comparison:
R2 indicates the proportion of the variance in the dependent variable that is predictable from the independent variables. It ranges from 0 to 1, with higher values indicating better model performance.
R 2 = 1 t = 1 n y t y ^ t 2 t = 1 n y t y ^ 2
where y represents the mean of the actual values.
8. 
Computation Time (TT):
Computation Time (TT) is the time it takes the model to train and generate forecasts. It is a crucial metric in practical applications where time efficiency is essential.
Measurement: TT is typically measured in seconds (s), and we record it using system functions that track the duration of the forecasting process.

3. Results and Discussion

3.1. Data Cleaning and Initialization

Data cleaning and imputation were automatic and fast for the entire series. For the Setup (), the following is considered: the target is consumption, the total data items consist of 132 for training, 120 reserved, and 12 for testing; we reserve these last readings for the validation of the forecast corresponding to the year 2018, the cross-validation is with k-fold = 3 and the rest in the standard PyCaret configuration.

3.2. Model Comparison

PyCaret chooses the best_model with the compare_models() function, which uses all eight metrics. Figure 3a,b compares performance metrics between different models and provides a summary of the best-performing models based on the combined metrics.
The bar charts above compare the performance of different models based on various metrics. We summarize the critical observations:
MASE and RMSSE:
Top Models: Exponential Smoothing, AdaBoost with Conditional Deseasonalize and Detrending, ETS.
Observation: Exponential Smoothing shows the lowest MASE and RMSSE values, indicating it performs well regarding these error metrics.
MAE and RMSE:
Top Models: Exponential Smoothing, AdaBoost with Conditional Deseasonalize and Detrending, ETS.
Observation: Exponential Smoothing has the lowest MAE and RMSE, making it a strong candidate for minimizing absolute and squared errors.
MAPE and SMAPE:
Top Models: Exponential Smoothing, AdaBoost with Conditional Deseasonalize and Detrending, ETS.
Observation: These models consistently show lower values for MAPE and SMAPE, indicating better performance in percentage error metrics.
R2:
Top Models: AdaBoost with Conditional Deseasonalize and Detrending, ETS.
Observation: AdaBoost with Conditional Deseasonalize and detrending shows the highest R2 value, indicating that it explains the most variance in the data.
TT (Sec):
Top Models (Least Time): Exponential Smoothing, ETS.
Observation: Exponential Smoothing and ETS are among the fastest models, making them efficient in terms of computation time.
Recommendations
Best Overall Model: Exponential Smoothing
Reason: It consistently performs well across all error metrics and has a low computation time.
Runner-Up Models:
AdaBoost with Conditional Deseasonalize and Detrending: Shows high R2 and good performance across other metrics.
ETS: Good balance of performance and computation time.
We should consider these models for forecasting monthly electricity consumption demand due to their strong performance across multiple metrics and efficiency in computation.

3.3. Model Creation and Training

When creating the models, the hyperparameters are adjusted through cross-validation with k-fold = 3. The results of the 3 models are shown in Table 2 and Figure 4.
Figure 4 shows the mean and variance and a minimum deviation in their means. Figure 4a–c corresponds to the values of the means and their deviations between −0.1246 and 1.0048. Figure 4d–f corresponds to the means values and their deviations between 3162.6573 and 7167.3498.

3.4. Model Comparison

We show the forecasts in Table 3 and Figure 5.
Analyzing Table 3 and Figure 5, we observe that the forecast data for electricity consumption demand is significant in most months except for August, September, and October, which represents more than 75% acceptance of the forecast referring to the consumption of the year 2018.

3.5. Forecast Validation

Below, Table 4 and Figure 6, Figure 7 and Figure 8 show the metrics for comparing the actual value and the forecast of monthly readings for the 2018 forecast.
Table 4 and Figure 6 show the electricity consumption prediction metrics for the year 2018. The Exponential Smoothing model has the lowest values for all evaluation metrics (MASE, RMSSE, MAE, RMSE, MAPE, SMAPE) and the least negative R2. Therefore, it is the best-performing model among those listed.

4. Conclusions

This study demonstrates that PyCaret’s machine learning models, particularly exponential smoothing and adaptive boosting with deseasonalization and conditional detrending, can effectively forecast monthly electricity consumption in industrial environments. These models provide accurate predictions and can be critical for energy planning and management. Future research should explore integrating additional external factors and advanced deep-learning models to improve forecast accuracy.

Author Contributions

A.C.F.Q. and N.C.L.C.: software, formal analysis, writing—original draft, visualization. J.O.Q.Q.: conceptualization, methodology, resources, writing—review and editing. O.C.T.: conceptualization, methodology, resources, writing—review and editing, supervision. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Data are available upon request.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Chong, M.; Aguilar, R. Proyección de Series de Tiempo para el Consumo de la Energía Eléctrica a Clientes Residenciales en Ecuador. Rev. Tecnológica ESPOL-RTE 2016, 29, 56–76. [Google Scholar]
  2. Mariño, M.D.; Arango, A.; Lotero, L.; Jimenez, M. Modelos de series temporales para pronóstico de la demanda eléctrica del sector de explotación de minas y canteras en Colombia. Rev. EIA 2021, 18, 35007. [Google Scholar] [CrossRef]
  3. Hyndman, R.J.; Khandakar, Y. Automatic Time Series Forecasting: The forecast Package for R. J. Stat. Softw. 2008, 27, 1–22. [Google Scholar] [CrossRef]
  4. Manzella, F.; Pagliarini, G.; Sciavicco, G.; Stan, I.E. The voice of COVID-19: Breath and cough recording classification with temporal decision trees and random forests. Artif. Intell. Med. 2023, 137, 102486. [Google Scholar] [CrossRef]
  5. Ersin, M.; Emre, N.; Eczacioglu, N.; Eker, E.; Yücel, K.; Bekir, H. Enhancing microalgae classification accuracy in marine ecosystems through convolutional neural networks and support vector machines. Mar. Pollut. Bull. 2024, 205, 116616. [Google Scholar] [CrossRef]
  6. Westergaard, G.; Erden, U.; Mateo, O.A.; Lampo, S.M.; Akinci, T.C.; Topsakal, O. Time Series Forecasting Utilizing Automated Machine Learning (AutoML): A Comparative Analysis Study on Diverse Datasets. Information 2024, 15, 39. [Google Scholar] [CrossRef]
  7. Arnaut, F.; Kolarski, A.; Srećković, V.A. Machine Learning Classification Workflow and Datasets for Ionospheric VLF Data Exclusion. Data 2024, 9, 17. [Google Scholar] [CrossRef]
  8. Kilic, K.; Ikeda, H.; Adachi, T.; Kawamura, Y. Soft ground tunnel lithology classification using clustering-guided light gradient boosting machine. J. Rock Mech. Geotech. Eng. 2023, 15, 2857–2867. [Google Scholar] [CrossRef]
  9. Jose, R.; Syed, F.; Thomas, A.; Toma, M. Cardiovascular Health Management in Diabetic Patients with Machine-Learning-Driven Predictions and Interventions. Appl. Sci. 2024, 14, 2132. [Google Scholar] [CrossRef]
  10. Effrosynidis, D.; Spiliotis, E.; Sylaios, G.; Arampatzis, A. Time series and regression methods for univariate environmental forecasting: An empirical evaluation. Sci. Total Environ. 2023, 875, 162580. [Google Scholar] [CrossRef]
  11. Malounas, I.; Lentzou, D.; Xanthopoulos, G.; Fountas, S. Testing the suitability of automated machine learning, hyperspectral imaging and CIELAB color space for proximal in situ fertilization level classification. Smart Agric. Technol. 2024, 8, 100437. [Google Scholar] [CrossRef]
  12. Gupta, R.; Yadav, A.K.; Jha, S.K.; Pathak, P.K. Long term estimation of global horizontal irradiance using machine learning algorithms. Optik 2023, 283, 170873. [Google Scholar] [CrossRef]
  13. Arunraj, N.S.; Ahrens, D. A hybrid seasonal autoregressive integrated moving average and quantile regression for daily food sales forecasting. Int. J. Prod. Econ. 2015, 170, 321–335. [Google Scholar] [CrossRef]
  14. Packwood, D.; Nguyen, L.T.H.; Cesana, P.; Zhang, G.; Staykov, A.; Fukumoto, Y.; Nguyen, D.H. Machine Learning in Materials Chemistry: An Invitation. Mach. Learn. Appl. 2022, 8, 100265. [Google Scholar] [CrossRef]
  15. Moreno, S.R.; Seman, L.O.; Stefenon, S.F.; dos Santos Coelho, L.; Mariani, V.C. Enhancing wind speed forecasting through synergy of machine learning, singular spectral analysis, and variational mode decomposition. Energy 2024, 292, 130493. [Google Scholar] [CrossRef]
  16. Slowik, A.; Moldovan, D. Multi-Objective Plum Tree Algorithm and Machine Learning for Heating and Cooling Load Prediction. Energies 2024, 17, 3054. [Google Scholar] [CrossRef]
  17. Abdu, D.M.; Wei, G.; Yang, W. Assessment of railway bridge pier settlement based on train acceleration response using machine learning algorithms. Structures 2023, 52, 598–608. [Google Scholar] [CrossRef]
  18. Muqeet, M.; Malik, H.; Panhwar, S.; Khan, I.U.; Hussain, F.; Asghar, Z.; Khatri, Z.; Mahar, R.B. Enhanced cellulose nanofiber mechanical stability through ionic crosslinking and interpretation of adsorption data using machine learning. Int. J. Biol. Macromol. 2023, 237, 124180. [Google Scholar] [CrossRef] [PubMed]
  19. Xin, L.; Yu, H.; Liu, S.; Ying, G.G.; Chen, C.E. POPs identification using simple low-code machine learning. Sci. Total Environ. 2024, 921, 171143. [Google Scholar] [CrossRef] [PubMed]
  20. Lynch, C.J.; Gore, R. Application of one-, three-, and seven-day forecasts during early onset on the COVID-19 epidemic dataset using moving average, autoregressive, autoregressive moving average, autoregressive integrated moving average, and naïve forecasting methods. Data Br. 2021, 35, 106759. [Google Scholar] [CrossRef] [PubMed]
  21. Prestwich, S.D.; Tarim, S.A.; Rossi, R. Intermittency and obsolescence: A Croston method with linear decay. Int. J. Forecast. 2021, 37, 708–715. [Google Scholar] [CrossRef]
  22. Nguyen, H.V.; Naeem, M.A.; Wichitaksorn, N.; Pears, R. A smart system for short-term price prediction using time series models. Comput. Electr. Eng. 2019, 76, 339–352. [Google Scholar] [CrossRef]
  23. Adam, M.L.; Moses, O.A.; Mailoa, J.P.; Hsieh, C.Y.; Yu, X.F.; Li, H.; Zhao, H. Navigating materials chemical space to discover new battery electrodes using machine learning. Energy Storage Mater. 2024, 65, 103090. [Google Scholar] [CrossRef]
  24. Yang, Y.; Yang, Y. Hybrid method for short-term time series forecasting based on EEMD. IEEE Access 2020, 8, 61915–61928. [Google Scholar] [CrossRef]
  25. Tolios, G. Simplifying Machine Learning with PyCaret A Low-Code Approach for Beginners and Experts! Leanpub: Victoria, BC, Canada, 2022. [Google Scholar]
  26. Hyndman, R.J.; Athanasopoulos, G. Forecasting: Principles and Practice; OTexts: Melbourne, Australia, 2018. [Google Scholar]
  27. Freund, Y.; Schapire, R.E. A Decision-Theoretic Generalization of On-Line Learning and an Application to Boosting. J. Comput. Syst. Sci. 1997, 55, 119–139. [Google Scholar] [CrossRef]
  28. Pati, Y.C.; Rezaiifar, R.; Krishnaprasad, P.S. Orthogonal matching pursuit: Recursive function approximation with applications to wavelet decomposition. In Proceedings of the 27th Asilomar Conference on Signals, Systems and Computers, Pacific Grove, CA, USA, 1–3 November 1993; Volume 1, pp. 40–44. [Google Scholar]
  29. Fix, E.; Hodges, J.L. Discriminatory Analysis. Nonparametric Discrimination: Consistency Properties. Int. Stat. Rev./Rev. Int. Stat. 1989, 57, 238–247. [Google Scholar] [CrossRef]
  30. Hoerl, A.E.; Kennard, R.W. Ridge Regression: Biased Estimation for Nonorthogonal Problems. Technometrics 1970, 12, 55–67. [Google Scholar] [CrossRef]
  31. Geurts, P.; Ernst, D.; Wehenkel, L. Extremely randomized trees. Mach. Learn. 2006, 63, 3–42. [Google Scholar] [CrossRef]
  32. Breiman, L.; Friedman, J.H.; Olshen, R.A.; Stone, C.J. Classification And Regression Trees, 1st ed.; Routledge: New York, NY, USA, 2017; ISBN 9781315139470. [Google Scholar]
  33. Tibshirani, R. Regression Shrinkage and Selection via the Lasso. R. Stat. Soc. 1996, 58, 267–288. [Google Scholar] [CrossRef]
  34. Zou, H.; Hastie, T. Regularization and variable selection via the elastic net. J. R. Stat. Soc. Ser. B Stat. Methodol. 2005, 67, 301–320. [Google Scholar] [CrossRef]
  35. Draper, N.R.; Smith, H. Applied Regression Analysis, 3rd ed.; John Wiley Sons, Inc.: Hoboken, NJ, USA, 1998. [Google Scholar]
  36. Efron, B.; Hastie, T.; Johnstone, I.; Tibshirani, R.; Ishwaran, H.; Knight, K.; Loubes, J.M.; Massart, P.; Madigan, D.; Ridgeway, G.; et al. Least angle regression. Ann. Stat. 2004, 32, 407–499. [Google Scholar] [CrossRef]
  37. Assimakopoulos, V.; Nikolopoulos, K. The theta model: A decomposition approach to forecasting. Int. J. Forecast. 2000, 16, 521–530. [Google Scholar] [CrossRef]
  38. Friedman, J.H. Greedy function approximation: A gradient boosting machine. Ann. Stat. 2001, 29, 1189–1232. [Google Scholar] [CrossRef]
  39. Ke, G.; Meng, Q.; Finley, T.; Wang, T.; Chen, W.; Ma, W.; Ye, Q.; Liu, T.Y. LightGBM: A highly efficient gradient boosting decision tree. In Proceedings of the 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA, 4–9 December 2017. [Google Scholar]
  40. Collins, J.R. Robust Estimation of a Location Parameter in the Presence of Asymmetry. Ann. Stat. 1976, 4, 68–85. [Google Scholar] [CrossRef]
  41. Cleveland, R.B.; Cleveland, W.S.; McRae, J.E.; Terpnning, I. STL: A Seasonal-Trend Decomposition Procedure Based on Loess. J. Off. Stat. 1974, 6, 477–482. [Google Scholar] [CrossRef]
  42. Chen, T.; Guestrin, C. XGBoost: A scalable tree boosting system. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, San Francisco, CA, USA, 13–17 August 2016; Volume 13–17, pp. 785–794. [Google Scholar]
  43. Box, G. Box and Jenkins: Time Series Analysis, Forecasting and Control. In A very British Affair; Palgrave Macmillan: London, UK, 2013; ISBN 978-1-349-35027-8. [Google Scholar]
  44. Croston, J.D. Forecasting and Stock Control for Intermittent Demands. Oper. Res. Q. 1972, 23, 289–303. [Google Scholar] [CrossRef]
  45. Aiolfi, M.; Capistrán, C.; Timmermann, A. Forecast Combinations. In The Oxford Handbook of Economic Forecasting; Oxford Academic: Oxford, UK, 2012; p. 35. ISBN 9780199940325. [Google Scholar]
  46. Quinde, B. Southern: Perú puede convertirse en el primer productor mundial de cobre. Available online: https://www.rumbominero.com/peru/peru-productor-mundial-de-cobre/ (accessed on 28 September 2023).
  47. Tabares Muñoz, J.F.; Velásquez Galvis, C.A.; Valencia Cárdenas, M. Comparison of Statistical Forecasting Techniques for Electrical Energy Demand. Rev. Ing. Ind. 2014, 13, 19–31. [Google Scholar]
Figure 1. Location of Moquegua.
Figure 1. Location of Moquegua.
Materproc 18 00005 g001
Figure 2. Workflow of methodology in Pycaret.
Figure 2. Workflow of methodology in Pycaret.
Materproc 18 00005 g002
Figure 3. (a) Comparison of eight metrics. (b) Comparison of eight metrics.
Figure 3. (a) Comparison of eight metrics. (b) Comparison of eight metrics.
Materproc 18 00005 g003aMaterproc 18 00005 g003b
Figure 4. Cross-validation boxes and whiskers of the three best models with the metrics MASE, RMSE, MAPE, SMAPE and R2 between −0.1246 and 1.00481 (ac) and the metrics MAE and RMSE between 3162.6573 and 7167.3498 (df).
Figure 4. Cross-validation boxes and whiskers of the three best models with the metrics MASE, RMSE, MAPE, SMAPE and R2 between −0.1246 and 1.00481 (ac) and the metrics MAE and RMSE between 3162.6573 and 7167.3498 (df).
Materproc 18 00005 g004
Figure 5. Accurate readings and forecasting readings of electricity consumption demand for 2018.
Figure 5. Accurate readings and forecasting readings of electricity consumption demand for 2018.
Materproc 18 00005 g005
Figure 6. Dataset and its forecast, Exponential Smoothing.
Figure 6. Dataset and its forecast, Exponential Smoothing.
Materproc 18 00005 g006
Figure 7. Dataset and its forecast, Ada boost Regressor.
Figure 7. Dataset and its forecast, Ada boost Regressor.
Materproc 18 00005 g007
Figure 8. Dataset and its forecast, ETS.
Figure 8. Dataset and its forecast, ETS.
Materproc 18 00005 g008
Table 1. Overview of Machine Learning Methods for Electricity Consumption Forecasting in PyCaret.
Table 1. Overview of Machine Learning Methods for Electricity Consumption Forecasting in PyCaret.
Method Originator(s) Reference
1Exponential SmoothingRobert G. Brown (1956)Forecasting: principles and practice [26].
2 Adaptive Boosting with Conditional Deseasonalization and Detrending Yoav Freund and Robert Schapire (1997) A decision–theoretic generalization of online learning and an application to boosting [27]
3Error, Trend, Seasonal (ETS)Hyndman et al. (2002)Automatic time series forecasting: the forecast package for R [3].
4 Orthogonal Matching Pursuit with Conditional Deseasonalization and Detrending Y. C. Pati, R. Rezaiifar, and P. S. Krishnaprasad (1993) Orthogonal matching pursuit: Recursive function approximation with applications to wavelet decomposition [28].
5 K-Nearest Neighbors with Conditional Deseasonalization and Detrending Evelyn Fix and Joseph Hodges (1951) Discriminatory analysis: Nonparametric discrimination: Consistency properties [29].
6 Bayesian Ridge Regression with Conditional Deseasonalization and Detrending Harold Jeffreys (1946); Arthur E. Hoerl and Robert W. Kennard (1970) Ridge regression: Biased estimation for nonorthogonal problems [30].
7 Extra Trees Regressor with Conditional Deseasonalization and Detrending Pierre Geurts, Damien Ernst, and Louis Wehenkel (2006) Extremely randomized trees [31].
8 Random Forest Regressor with Conditional Deseasonalization and Detrending Leo Breiman (2001)Random forests [32].
9 Lasso Regression with Conditional Deseasonalization and Detrending Robert Tibshirani (1996)Regression shrinkage and selection via the lasso [33].
10 Elastic Net Regression with Conditional Deseasonalization and Detrending Hui Zou and Trevor Hastie (2005)Regularization and variable selection via the elastic net [34].
11 Ridge Regression with Conditional Deseasonalization and Detrending Arthur E. Hoerl and Robert W. Kennard (1970) Ridge regression: Biased estimation for nonorthogonal problems [30].
12 Linear Regression with Conditional Deseasonalization and Detrending Carl Friedrich Gauss (1795)Applied regression analysis [35].
13 Least Angle Regression with Conditional Deseasonalization and Detrending Bradley Efron, Trevor Hastie, Iain Johnstone, and Robert Tibshirani (2004) Least angle regression [36].
14Theta Forecasting ModelAssimakopoulos and Nikolopoulos (2000)The theta model: a decomposition approach to forecasting [37].
15 Gradient Boosting Regressor with Conditional Deseasonalization and Detrending Jerome H. Friedman (2001)Greedy function approximation: A gradient boosting machine [38].
16 Light Gradient Boosting Machine with Conditional Deseasonalization and Detrending Guolin Ke, Qi Meng, Thomas Finley, Taifeng Wang, Wei Chen, Weidong Ma, Qiwei Ye, and Tie-Yan Liu (2017) LightGBM: A highly efficient gradient boosting decision tree [39].
17 Huber Regressor with Conditional Deseasonalization and Detrending Peter J. Huber (1964)Robust estimation of a location parameter [40].
18 Seasonal and Trend decomposition using Loess Forecasting (STLF) Cleveland et al. (1990)STL: A seasonal-trend decomposition procedure based on loess [41].
19 Extreme Gradient Boosting with Conditional Deseasonalization and Detrending Tianqi Chen and Carlos Guestrin (2016) XGBoost: A scalable tree boosting system [42].
20 AutoRegressive Integrated Moving Average (ARIMA) George Box and Gwilym Jenkins (1970) Time series analysis: forecasting and control [43].
21Seasonal Naive Forecaster Commonly used technique in time series forecasting Forecasting: principles and practice [26].
22Polynomial Trend Forecaster Based on polynomial regression techniques Applied regression analysis [35].
23 Decision Tree Regressor with Conditional Deseasonalization and Detrending Breiman et al. (1984)Classification and regression trees [32].
24Croston’s Forecasting ModelJ. D. Croston (1972)Forecasting and stock control for intermittent demands [44].
25Automated ARIMA (Auto ARIMA)Hyndman et al. (2008)Automatic time series forecasting: the forecast package for R [3].
26Naive Forecaster Commonly used technique in time series forecasting Forecasting: principles and practice [26].
27 Ensemble of Mainstream Media Forecasters Concept based on combining multiple forecasting models Forecast combinations [45].
Table 2. Cross-validation for the three best-performing models.
Table 2. Cross-validation for the three best-performing models.
Exponential SmoothCross-validation
cutoffMASERMSSEMAERMSEMAPESMAPER2
02014-120.79060.73493793.66235544.26170.02630.0270.2432
12015-120.77820.85933756.69676536.85180.02830.02730.1185
22016-120.93870.73484486.37385686.7790.03110.0314−0.1246
MeanNaT0.83590.77634012.24435922.63080.02860.02850.079
SDNaT0.07290.0587335.5997438.19960.00190.0020.1527
Ada Boost Cross-validation
cutoffMASERMSSEMAERMSEMAPESMAPER2
02014-120.65910.52773162.65733981.55990.02220.02240.6097
12015-120.90640.94214375.42257167.34980.03270.0318−0.0597
22016-120.98650.67584714.4415230.12160.03290.03280.0488
MeanNaT0.85070.71524084.17365459.67710.02930.0290.1996
SDNaT0.13940.1715666.1471310.68330.0050.00470.2934
ETS Cross-validation
cutoffMASERMSSEMAERMSEMAPESMAPER2
02014-120.75650.57993630.25014375.38480.02560.02590.5287
12015-120.8270.92463992.00247033.9120.03010.0289−0.0206
22016-121.00480.68444802.19975296.54560.03340.03350.0245
MeanNaT0.86280.72964141.48415568.61410.02970.02940.1775
SDNaT0.10450.1443489.9831102.25760.00320.00310.249
Table 3. Accurate readings and forecasting readings of electricity consumption demand for 2018.
Table 3. Accurate readings and forecasting readings of electricity consumption demand for 2018.
Forecasting Readings
MonthReal ReadingsExponential Smooth Ada Boost ETS
January142,750148,308.1503 151,519.7874 148,628.8883
February133,250135,222.6153 138,284.8118 136,198.3163
March145,600149,447.2654 149,085.8093 150,919.0335
April143,100142,234.6333 141,893.4414 142,582.7082
May145,000150,585.6266 149,222.6028 150,645.0903
June150,250146,790.2941 146,041.0431 147,550.7761
July155,750151,543.3057 152,364.0477 151,849.2819
August158,20014,6360.584 142,519.8809 142,832.7324
September153,150140,594.03 136,103.4339 137,931.3421
October163,400142,708.9193 143,023.5895 144,914.2118
November143,600143,898.9958 146,144.4833 146,119.9649
December143,500151,008.7511 149,992.7002 150,895.2123
Table 4. Metrics of the forecasting readings.
Table 4. Metrics of the forecasting readings.
ModelMASERMSSEMAERMSEMAPESMAPER2
Exponential Smoothing1.33731.09596532.46988629.48110.04270.0437−0.1818
AdaBoostRegressor1.57721.25037704.56329845.28110.05070.0521−0.5383
ETS1.46531.15747157.95449113.66320.0470.0481−0.3181
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Quispe, J.O.Q.; Quispe, A.C.F.; Calvo, N.C.L.; Toledo, O.C. Analysis and Selection of Multiple Machine Learning Methodologies in PyCaret for Monthly Electricity Consumption Demand Forecasting. Mater. Proc. 2024, 18, 5. https://doi.org/10.3390/materproc2024018005

AMA Style

Quispe JOQ, Quispe ACF, Calvo NCL, Toledo OC. Analysis and Selection of Multiple Machine Learning Methodologies in PyCaret for Monthly Electricity Consumption Demand Forecasting. Materials Proceedings. 2024; 18(1):5. https://doi.org/10.3390/materproc2024018005

Chicago/Turabian Style

Quispe, José Orlando Quintana, Alberto Cristobal Flores Quispe, Nilton Cesar León Calvo, and Osmar Cuentas Toledo. 2024. "Analysis and Selection of Multiple Machine Learning Methodologies in PyCaret for Monthly Electricity Consumption Demand Forecasting" Materials Proceedings 18, no. 1: 5. https://doi.org/10.3390/materproc2024018005

APA Style

Quispe, J. O. Q., Quispe, A. C. F., Calvo, N. C. L., & Toledo, O. C. (2024). Analysis and Selection of Multiple Machine Learning Methodologies in PyCaret for Monthly Electricity Consumption Demand Forecasting. Materials Proceedings, 18(1), 5. https://doi.org/10.3390/materproc2024018005

Article Metrics

Back to TopTop