# Energy Consumption Load Forecasting Using a Level-Based Random Forest Classifier

^{1}

^{2}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Machine Learning Methodology

#### 2.1. Machine Learning Pipeline and Implementation

Algorithm 1. Machine Learning Implementation |

# Initialization |

In the initialization stage, data pre-processing is performed such as the loading and shuffle-splitting of the dataset into feature X and predictor y, and the importation of the necessary python-based libraries. |

# Repeat n times the training and testing of the model |

for i=1:n |

Shuffle-splitting of dataset into training, validation, and testing datasets |

# k-time Training Cross-Validation |

for j=1:k-time |

Training of the model using an ML algorithm using the training dataset |

Performance evaluation of the trained model using the validation dataset |

# Testing the model |

Testing of the trained model using the testing dataset |

Performance evaluation of the tested model |

# Display Performance Results |

Compute classification accuracy and F-score |

Compute classification confusion matrix |

#### 2.2. Random Forest Classifier

## 3. Energy Data Processing

## 4. Results and Discussion

## 5. Conclusions

## Author Contributions

## Conflicts of Interest

## References

- Zhao, H.X.; Magoulès, F. A review on the prediction of building energy consumption. Renew. Sustain. Energy Rev.
**2012**, 16, 3586–3592. [Google Scholar] [CrossRef] - Fumo, N.; Rafe Biswas, M.A. Regression analysis for prediction of residential energy consumption. Renew. Sustain. Energy Rev.
**2015**, 47, 332–343. [Google Scholar] [CrossRef] - Ahmad, A.S.; Hassan, M.Y.; Abdullah, M.P.; Rahman, H.A.; Hussin, F.; Abdullah, H.; Saidur, R. A review on applications of ANN and SVM for building electrical energy consumption forecasting. Renew. Sustain. Energy Rev.
**2014**, 33, 102–109. [Google Scholar] [CrossRef] - Hong, T.; Fan, S. Probabilistic electric load forecasting: A tutorial review. Int. J. Forecast.
**2016**, 32, 914–938. [Google Scholar] [CrossRef] - Raza, M.Q.; Khosravi, A. A review on artificial intelligence based load demand forecasting techniques for smart grid and buildings. Renew. Sustain. Energy Rev.
**2015**, 50, 1352–1372. [Google Scholar] [CrossRef] - Yildiz, B.; Bilbao, J.I.; Sproul, A.B. A review and analysis of regression and machine learning models on commercial building electricity load forecasting. Renew. Sustain. Energy Rev.
**2017**, 73, 1104–1122. [Google Scholar] [CrossRef] - Menezes, A.C.; Cripps, A.; Buswell, R.A.; Wright, J.; Bouchlaghem, D. Estimating the energy consumption and power demand of small power equipment in office buildings. Energy Build.
**2014**, 75, 199–209. [Google Scholar] [CrossRef] [Green Version] - Tsekouras, G.J.; Kanellos, F.D.; Mastorakis, N. Short term load forecasting in electric power systems with artificial neural networks. In Computational Problems in Science and Engineering; Springer: Berlin, Germany, 2015; pp. 19–58. [Google Scholar]
- Chaturvedi, D.K.; Sinha, A.P.; Malik, O.P. Short term load forecast using fuzzy logic and wavelet transform integrated generalized neural network. Int. J. Electr. Power Energy Syst.
**2015**, 67, 230–237. [Google Scholar] [CrossRef] - Li, S.; Wang, P.; Goel, L. Short-term load forecasting by wavelet transform and evolutionary extreme learning machine. Electr. Power Syst. Res.
**2015**, 122, 96–103. [Google Scholar] [CrossRef] - Jain, R.K.; Smith, K.M.; Culligan, P.J.; Taylor, J.E. Forecasting energy consumption of multi-family residential buildings using support vector regression: Investigating the impact of temporal and spatial monitoring granularity on performance accuracy. Appl. Energy
**2014**, 123, 168–178. [Google Scholar] [CrossRef] - Massana, J.; Pous, C.; Burgas, L.; Melendez, J.; Colomer, J. Short-term load forecasting in a non-residential building contrasting models and attributes. Energy Build.
**2015**, 92, 322–330. [Google Scholar] [CrossRef] [Green Version] - Chitsaz, H.; Shaker, H.; Zareipour, H.; Wood, D.; Amjady, N. Short-term electricity load forecasting of buildings in microgrids. Energy Build.
**2015**, 99, 50–60. [Google Scholar] [CrossRef] - Candanedo, L.M.; Feldheim, V.; Deramaix, D. Data driven prediction models of energy use of appliances in a low-energy house. Energy Build.
**2017**, 140, 81–97. [Google Scholar] [CrossRef] - Virote, J.; Neves-Silva, R. Stochastic models for building energy prediction based on occupant behavior assessment. Energy Build.
**2012**, 53, 183–193. [Google Scholar] [CrossRef] - Oldewurtel, F.; Parisio, A.; Jones, C.N.; Morari, M.; Gyalistras, D.; Gwerder, M.; Stauch, V.; Lehmann, B.; Wirth, K. Energy efficient building climate control using Stochastic Model Predictive Control and weather predictions. In Proceedings of the 2010 American Control Conference, Baltimore, MD, USA, 30 June–2 July 2010; pp. 5100–5105. [Google Scholar]
- Arghira, N.; Hawarah, L.; Ploix, S.; Jacomino, M. Prediction of appliances energy use in smart homes. Energy
**2012**, 48, 128–134. [Google Scholar] [CrossRef] - Castelli, M.; Trujillo, L.; Vanneschi, L. Prediction of energy performance of residential buildings: A genetic programming approach. Energy Build.
**2015**, 102, 67–74. [Google Scholar] [CrossRef] - Tsanas, A.; Xifara, A. Accurate quantitative estimation of energy performance of residential buildings using statistical machine learning tools. Energy Build.
**2012**, 49, 560–567. [Google Scholar] [CrossRef] - Li, K.; Su, H.; Chu, J. Forecasting building energy consumption using neural networks and hybrid neuro-fuzzy system: A comparative study. Energy Build.
**2011**, 43, 2893–2899. [Google Scholar] [CrossRef] - Chang, H.-C.; Kuo, C.-C.; Chen, Y.-T.; Wu, W.-B.; Piedad, E.J. Energy Consumption Level Prediction Based on Classification Approach with Machine Learning Technique. In Proceedings of the 4th World Congress on New Technologies (NewTech’18), Madrid, Spain, 19–21 August 2018; pp. 1–8. [Google Scholar]
- Pedregosa, F.; Varoquaux, G.; Gramfort, A.; Michel, V.; Thirion, B.; Grisel, O.; Blondel, M.; Müller, A.; Nothman, J.; Louppe, G.; et al. Scikit-learn: Machine Learning in Python. J. Mach. Learn. Res.
**2011**, 12, 2825–2830. [Google Scholar] - Bickel, P.; Diggle, P.; Fienberg, S.; Gather, U.; Olkin, I.; Zeger, S. Springer Series in Statistics; Springer: New York, NY, USA, 2009. [Google Scholar]
- Breiman, L. Random forests. Mach. Learn.
**2001**, 45, 5–32. [Google Scholar] [CrossRef] - Pîrjan, A.; Oprea, S.V.; Carutasu, G.; Petrosanu, D.M.; Bâra, A.; Coculescu, C. Devising hourly forecasting solutions regarding electricity consumption in the case of commercial center type consumers. Energies
**2017**, 10, 1727. [Google Scholar] - Piedad, E.J.; Kuo, C.-C. A 12-Month Data of Hourly Energy Consumption Levels from a Commercial-Type Consumer. Available online: https://data.mendeley.com/datasets/n85kwcgt7t/1/files/6cfc7434-315c-4a2d-8d8c-ce6a2bb80a01/energy_consumption_levels.csv?dl=1 (accessed on 25 June 2018).

**Figure 1.**Pseudocode of a usual machine learning implementation with training and testing phases, and final evaluation stage.

**Figure 4.**Methodology and comparison of the conventional and the proposed time series machine learning classifiers (source: authors’ own conception).

**Figure 5.**Training and testing difference from the loss function graph of the random forest (RF) classifiers.

**Figure 6.**Parameter simulation of three cases, using (

**a**) three-energy level, (

**b**) five-energy level, and (

**c**) seven-energy level prediction of both methods.

n-Level Cases | Interval | Data Points |
---|---|---|

3-level | [0, 0.525) | 2927 |

[0.525, 0.807) | 2917 | |

[0.807, 1.36] | 2940 | |

5-level | [0, 0.366) | 1755 |

[0.366, 0.634) | 1756 | |

[0.634, 0.7816) | 1759 | |

[0.7816, 0.874) | 1752 | |

[0.874, 1.36] | 1762 | |

7-level | [0, 0.3366) | 1255 |

[0.3366, 0.427) | 1249 | |

[0.427, 0.675) | 1260 | |

[0.675, 0.771) | 1236 | |

[0.771, 0.827) | 1271 | |

[0.827, 0.935) | 1257 | |

[0.935, 1.36] | 1256 |

Classifier Models | Classification Accuracy | |||
---|---|---|---|---|

std_min | std_ave | std_max | ||

3-level | conventional | 0.0032 | 0.0106 | 0.9131 |

proposed | 0.0012 | 0.0048 | 0.0100 | |

5-level | conventional | 0.0024 | 0.0093 | 0.0206 |

proposed | 0.0023 | 0.0068 | 0.0148 | |

7-level | conventional | 0.0049 | 0.0100 | 0.0175 |

proposed | 0.0033 | 0.0070 | 0.0123 |

Proposed | F Score | |||
---|---|---|---|---|

min | std_ave | max | std | |

3-level | 0.0054 | 0.6491 | 3.3674 | 0.6388 |

5-level | 0.0085 | 1.0993 | 7.1509 | 0.9413 |

7-level | 0.0058 | 1.3333 | 5.2442 | 1.1107 |

© 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Chen, Y.-T.; Piedad, E., Jr.; Kuo, C.-C.
Energy Consumption Load Forecasting Using a Level-Based Random Forest Classifier. *Symmetry* **2019**, *11*, 956.
https://doi.org/10.3390/sym11080956

**AMA Style**

Chen Y-T, Piedad E Jr., Kuo C-C.
Energy Consumption Load Forecasting Using a Level-Based Random Forest Classifier. *Symmetry*. 2019; 11(8):956.
https://doi.org/10.3390/sym11080956

**Chicago/Turabian Style**

Chen, Yu-Tung, Eduardo Piedad, Jr., and Cheng-Chien Kuo.
2019. "Energy Consumption Load Forecasting Using a Level-Based Random Forest Classifier" *Symmetry* 11, no. 8: 956.
https://doi.org/10.3390/sym11080956