0% found this document useful (0 votes)
31 views

Predicting Peak Day and Peak Hour of Electricity Demand With Ensemble Machine Learning

Uploaded by

MICHEL MUÑOZ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

Predicting Peak Day and Peak Hour of Electricity Demand With Ensemble Machine Learning

Uploaded by

MICHEL MUÑOZ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

Predicting Peak Day and Peak Hour of Electricity Demand with

Ensemble Machine Learning

Tao Fu, Huifen Zhou, Xu Ma, Z. Jason Hou, Di Wu∗


Pacific Northwest National Laboratory, Richland, WA 99352 USA

Abstract

Battery energy storage systems can be used for peak demand reduction in power sys-
arXiv:2203.13886v1 [cs.LG] 25 Mar 2022

tems, leading to significant economic benefits. Two practical challenges are 1) ac-

curately determining the peak load days and hours and 2) quantifying and reducing

uncertainties associated with the forecast in probabilistic risk measures for dispatch

decision-making. In this study, we develop a supervised machine learning approach to

generate 1) the probability of the next operation day containing the peak hour of the

month and 2) the probability of an hour to be the peak hour of the day. Guidance

is provided on preparation and augmentation of data as well as selection of machine

learning models and decision-making thresholds. The proposed approach is applied to

the Duke Energy Progress system and successfully captures 69 peak days out of 72

testing months with a 3% exceedance probability threshold. On 90% of the peak days,

the actual peak hour is among the 2 hours with the highest probabilities.
Keywords: Batteries, electricity demand, energy storage, ensemble machine learning,

load forecast.


Corresponding author.
Email address: [email protected] (Di Wu)

Preprint submitted to International Journal of Forecasting March 29, 2022


1. Introduction

Many cooperatives, municipally owned utilities, and other types of load serving

entities (LSE) purchase power from electricity markets or through power purchase con-

tracts. A capacity charge is paid based on the coincident demand during system peak

hours. Effectively reducing the peak demand leads to significant economic benefits.

Battery energy storage systems (BESS) are promising for peak demand reduction be-

cause of their flexibility and instantaneous response capability. An LSE does not know

exactly when the peak hour will occur. Simply discharging BESS on all high-load days

helps capture the peak hour and reduce the coincident demand, but causes unnecessary

battery degradation and energy losses associated with charging/discharging. In addi-

tion, due to limited energy capacity, BESS may not be able to discharge at the rated

power in all high-load hours. Therefore, advanced peak day and peak hour forecast

methods are critical to maximizing benefits from BESS for peak demand reduction.

Predictions of the monthly peak hour can be derived from load forecast that spans

the entire month. Traditional methods, such as autoregressive integrated moving av-

erage (ARIMA), forecast load with univariate historical load. More advanced non-

linear machine learning (ML) methods have also been proposed for load forecasting

with multivariate predictors, including weather, calendar, and economics (Hong & Fan,

2016). Examples of advanced nonlinear ML methods are K-nearest neighbors (KNN)

(El-Attar, Goulermas & Wu, 2009), fuzzy regression models (Hong & Wang, 2014),

support vector machine (SVM) (Niu, Wang & Wu, 2010), gradient boosting machine

(GBM) (Massaoudi, Refaat, Chihi, Trabelsi, Oueslati & Abu-Rub, 2021), random for-

est (RF) (Cheng, Chan & Qiu, 2012; Huang, Lu & Xu, 2016), and artificial neural net-

works (ANN) (El Desouky & Elkateb, 2000; Ringwood, Bofelli & Murray, 2001; Saini,

2008). These approaches can also be combined to improve load forecasting. For ex-

ample, El Desouky & Elkateb (2000) developed a hybrid ANN with ARIMA for load

forecasting. El-Attar et al. (2009) proposed a multivariate load forecasting approach

by combining support vector regression with a KNN local prediction framework. A

monthly peak hour can be identified based on the value of the hourly load forecast. Such

a method requires the hourly load forecast toward the end of the month. There are sig-

nificant uncertainties associated with long-term hourly load forecast. A major challenge

of predicting peak hours based on load forecast is how to model and quantify uncer-

2
tainties, considering varying weather conditions (e.g., temperature, humidity, and wind

speed) and nonlinear relationships between weather and load (El Desouky & Elkateb,

2000).

Efforts have also been made to directly predict peak hours. For example,

Goodwin & Yazidi (2016) proposed an SVM and Gaussian mixture classification ap-

proach to directly estimate the peak hours for the next 7 days based on historical

load. Leveraging short-term load forecasts, Jiang, Levman, Golab & Nathwani (2014)

adopted a probabilistic approach for estimating the probability of the next day con-

taining the highest hourly demand of a year. A Naive Bayesian classification model

was proposed for classifying whether an hour is a 5CP (top 5 coincident peaks of a

year) hour (Ryu, Makanju, Lasek, An & Cercone, 2016). Liu & Brown (2019a) pro-

posed a convolutional neural network (CNN) classification model to predict 24 hours

ahead whether a day is a 5CP day. For the peak hour model, they built separate

models for summer and winter using different classification methods: Naive Bayes,

SVM, RF, AdaBoost, CNN, long short-term memory (LSTM), and stacked autoen-

coder (Liu & Brown, 2019b). More recently, Saxena, Aponte & McConky (2019) de-

veloped a hybrid classification model combining ARIMA, logistic regression (LR), and

ANN for peak day prediction.

Both load forecast and direct peak prediction ML models require enough data for

training and validation. In practice, however, complete historical records of load and

weather are not always available, which warrants the data augmentation effort. In

addition, these aforementioned approaches either ignored trailing or leading effects of

factors or skipped dimension reduction and physical interpretation of the factor con-

tributions. To summarize, despite the progress to date, additional research and devel-

opment are needed to better support BESS dispatch decision-making for peak demand

reduction, including 1) quantifying uncertainties associated with peak day and peak

hour predictions, 2) addressing the data inadequacy issue via ML data augmentation,

3) evaluating choices of peak day probability thresholds for decision-making considering

both prediction accuracy and precision, 4) including all physical and temporal factors

to fully capture their correlations and causalities with system load peaking behaviors,

e.g., trailing and leading effects, and 5) integrating ensemble ML model selection tech-

niques to deal with factor collinearity, mixed data types, and overfitting, as well as

3
trustworthy, explainable ML prediction.

In this paper, we propose an ensemble learning approach taking advantage of mul-

tiple ML techniques, including RF, GBM, and LR, for predicting peak day and peak

hour to better support BESS dispatch decision-making. To quantify the prediction un-

certainties, we develop, validate, compare, and select optimal ML models to generate

the probability of the next day to be the monthly peak day, and the probability of an

hour to be the peak hour of a day. The proposed approach also features ML-based

data augmentation to address the data inadequacy issues and a procedure to select

exceedance thresholds for decision-making. We use a comprehensive set of predictors,

including actual load in previous days of the month, day-ahead load forecast, weather

forecast, and their derivatives, as well as temporal factors to help improve peak pre-

dictions. By applying bagging and boosting techniques, the ensemble tree-based ML

method can help avoid overfitting and deal with unbalanced data of mixed types,

e.g., categorical vs. continuous (Domingos, 2012; Cieslak & Chawla, 2008; Breiman,

2001; Jaiswal & Samikannu, 2017; Friedman, 2001). We also use naive load-based

peak predictions to demonstrate the effectiveness of the proposed ML-based prediction

framework.

2. Dataset

The proposed ML-based prediction framework is generic and can be applied to any

system. The Duke Energy Progress (DEP) system is used for illustration and analysis

presented in this paper. The input dataset includes historical load and weather data,

which are described as follows.

2.1. DEP load

The DEP system consists of two balancing authorities: DEP East and DEP West.

The data are obtained from the Energy Information Administration (EIA, 2021), in-

cluding both day-ahead forecasts and actual demand with an hourly resolution. Com-

plete records are only available for about 6 years starting from July 2015. Data aug-

mentation is proposed and used to generate 21 years of data for training and testing

purposes, as described in Section 3.3.

4
16000

14000

Peak Load (MWh)


12000

10000

8000

6000

Mar

Apr

Sep

Oct

Dec
Nov
Jan

Jun

Jul
Feb

May

Aug
Fig. 1: Boxplot of monthly peak load from July 2015 to December 2020.

2015 2016 2017 2018 2019 2020


16000

14000
Load (MWh)

12000

10000

8000

6000

4000

Jan−01 Jan−11 Jan−21 Jan−31


(a) January

16000
2015 2016 2017 2018 2019 2020
14000
Load (MWh)

12000

10000

8000

6000

4000

Jul−01 Jul−06 Jul−11 Jul−16 Jul−21 Jul−26 Jul−31


(b) July

Fig. 2: Actual hourly load 2015-2020.

A boxplot of monthly peak load is provided in Fig. 1. As can be seen, the highest

monthly peak loads typically occur in mid-winter (e.g., January) and mid-summer

(e.g., July). Fig. 2 plots the system load vs. time for January and July. The peak

day can occur at the beginning, in the middle, or at the end of a month, and there is

no obvious pattern, which increases the difficulty for peak day prediction. The peak

days in January exhibit strong variations over the years yet no dominant timings and

durations of peak days.

5
0.6 Jan 0.6 Feb 0.6 Mar 0.6 Apr
0.5 0.5 0.5 0.5

Probability

Probability

Probability

Probability
0.4 0.4 0.4 0.4
0.3 0.3 0.3 0.3
0.2 0.2 0.2 0.2
0.1 0.1 0.1 0.1
0.0 0.0 0.0 0.0
0 4 8 13 19 0 4 8 13 19 0 4 8 13 19 0 4 8 13 19
Hour Hour Hour Hour
0.6 May 0.6 Jun 0.6 Jul 0.6 Aug
0.5 0.5 0.5 0.5
Probability

Probability

Probability

Probability
0.4 0.4 0.4 0.4
0.3 0.3 0.3 0.3
0.2 0.2 0.2 0.2
0.1 0.1 0.1 0.1
0.0 0.0 0.0 0.0
0 4 8 13 19 0 4 8 13 19 0 4 8 13 19 0 4 8 13 19
Hour Hour Hour Hour
0.6 Sep 0.6 Oct 0.6 Nov 0.6 Dec
0.5 0.5 0.5 0.5
Probability

Probability

Probability

Probability
0.4 0.4 0.4 0.4
0.3 0.3 0.3 0.3
0.2 0.2 0.2 0.2
0.1 0.1 0.1 0.1
0.0 0.0 0.0 0.0
0 4 8 13 19 0 4 8 13 19 0 4 8 13 19 0 4 8 13 19
Hour Hour Hour Hour

Fig. 3: Distribution of daily peak hour by month from July 2015 to December 2020.

Fig. 3 shows the varying distributions of peak hours by month from July 2015 to

December 2020. In January and February, a majority of peak hours occurred at 8 a.m.

In March, November, and December, the peak hours had a bimodal distribution with

one peak in the morning hours and the other peak in the evening hours. In April and

October, the peak hours happened in the later evening, hour 21 for April and hour

20 for October. From May to September, a majority of peak hours were in the early

evening hours, around hour 17 or 18.

2.2. Weather data

The weather datasets are obtained from the National Oceanic and Atmospheric

Administration website (NOAA, 2021). In this study, the weather data at the Raleigh

weather station are used as it is the closest weather station to the city of Raleigh, which

is the geographic center of DEP and the second biggest city in North Carolina. The raw

weather data include dry-bulb air temperature, dew point temperature, wind speed,

and visibility, with temporal resolutions between 15 minutes to an hour from 2000 to

2020. To match the temporal resolution and coverage of the load data, the weather

data are mapped to the nearest exact hours to generate hourly data. In addition, the

6
40

30

Temperature (°C)
20

10

−10
Max Temp Min Temp
−20

6000 8000 10000 12000 14000 16000


Daily Peak Load (MWh)

(a) January
40

30
Temperature (°C)

20

10

−10
Max Temp Min Temp
−20

6000 8000 10000 12000 14000 16000


Daily Peak Load (MWh)

(b) July

Fig. 4: Daily peak load vs. daily maximum and minimum temperature.

Table 1: R-squared of daily peak load vs. daily minimum and maximum temperature.

Jan. Feb. Mar. Apr. May June July Aug. Sept. Oct. Nov. Dec.
T min 0.86 0.72 0.58 0.04 0.57 0.39 0.30 0.33 0.36 0.38 0.40 0.74
T max 0.58 0.50 0.29 0.11 0.80 0.80 0.73 0.77 0.77 0.50 0.26 0.56

hourly humidity H is calculated according to Bosen (1958):

17.625 × DT 17.625 × T
 
H = exp − × 100% , (1)
243.04 + DT 243.04 + T

where T is the dry-bulb air temperature (℃), DT is the dew point temperature (℃),

and exp(·) is the exponential function.

3. Methodology

3.1. Calculation of peak day and peak hour probabilities

3.1.1. Peak day model

There is a strong and nonlinear correspondence between power system load and

weather (Sobhani, Hong & Martin, 2020). Fig. 4 plots the DEP daily peak load vs.

7
Table 2: Predictors for the peak day model.

Predictor Description
load max Maximum load from the day-ahead forecast
T min* Minimum temperature from the day-ahead forecast
T max* Maximum temperature from the day-ahead forecast
weekdayIdx 0 or 1 indicating whether the next day is weekday or weekend
prev month max Maximum actual load of the month to date
prev MAX Maximum actual load on previous day
T min day 2 to 7* Minimum forecast temperature within the next 2 to 7 days
T max day 2 to 7* Maximum forecast temperature within the next 2 to 7 days

minimum and maximum temperature on each day in January and July from July

2015 to December 2020. The R-squared values between the daily minimum/maximum

temperatures and the daily peak load for all months are listed in Table 1. Two key

observations are highlighted as follows:

• There is a strong negative correlation (with R2 > 0.7) between the daily minimum

temperature and load in winter months (December to February), and a strong

positive correlation between the daily maximum temperature and load in summer

months (May to September).

• The correlation between daily peak load and daily minimum and maximum tem-

perature is relatively weak (R2 ≤ 0.5) in spring and fall (March, April, May,

October, and November), which suggests that temperature is a less effective pre-

dictor of peak load during these months.

Based on these observations, both direct and indirect models are developed and

tested in this study. The selected predictors are the same for both models, includ-

ing load and weather variables that are derived from the hourly data and a week-

day/weekend indicator, as listed in Table 2. Because of the lack of historical weather

forecast data, actual weather data are used for the ML model development.

• The direct model directly predicts whether the next day is the peak day of the

month. In this model, a binary response variable takes a value of 1 if a day is the

monthly peak day and 0 otherwise. Ideally, the predictors should also include

the load and weather forecast toward the end of the month to better capture how

future load may affect whether the next day is the peak day. However, long-term

load and weather forecasts are generally unavailable and therefore only forecasts

8
of up to 7 days are used as predictors. As a result, the direct model actually links

partial month predictors to the full month peak day indicator.

• The indirect model outputs the probability of the next day to be the up-to-

date peak day, which is defined as the peak day of a time window starting from

the beginning of the month and ending at day 7 into the future or the end

of the month. Therefore, the model links predictors to the peak day indicator

at the exactly matched time window. Then, the obtained up-to-date peak day

probability (Pdate ) is converted to the monthly peak day probability (Pmonth ) by

applying a multiplier (Pmul ) that reflects the chance of the monthly peak day

occurring within the up-to-date time window, as expressed in (2):

Pmonth = Pdate Pmul . (2)

The multipliers corresponding to different time windows can be generated by

examining the distribution of historical peak days. It is found that the chance is

generally proportional to the length of the time windows in a given month. In

other words, each day in a month has an equal probability to be the monthly

peak day. Therefore, the multiplier can be defined as

n+6
Pmul = min[1, ], (3)
N

where N is the number of days of the current month and n is the day of the month

for the next day. Unlike the direct model, which completely ignores the impacts

of the load beyond 7 days, the indirect model takes future load into account in a

stochastic manner.

3.1.2. Peak hour model

The peak hour model is trained using the hourly load and weather data. The

response variable is a binary variable that indicates whether an hour is the peak hour

of the day. The predictors include both hourly load forecast and weather data for the

operating day, as well as a weekday or weekend binary indicator, as listed in Table 3.

We have the following considerations for including the major predictors:

• For each hour t, we use not only the temperature and humidity for the hour, as

9
they directly impact the load components, e.g., heating and cooling, but also the

temperature from t − 3 to t + 3 to explore the trailing or leading effects between

temperature and load.

• Similarly, the forecast loads from hour t − 3 to t + 3 are included in the predictors

because the peaks tend to cluster in groups.

• The rank of load forecast for hour t is included to distinguish the peak hour from

other hours, particularly those with comparable loading levels.

• The maximums of load forecast before and after hour t are included to describe

the relative position of the load in hour t with respect to highs in the past and

future hours of the day. In comparison to load forecast of each hour beyond hours

t − 3 to t + 3, the use of these two predictors helps reduce modeling complexity

and avoid overfitting, while effectively capturing the overall impacts of the other

hours on the operating day.

• In addition, as adjacent days tend to have more similar peaking behaviors, at-

tributes from the previous day, including the rank of actual load for hour t, the

forecast, and the actual load for hour t, are also used as predictors.

3.2. ML models

Given the high dimensionality of the predictors and the expected non-linear rela-

tionships with response variables, we adopt the ensemble tree-based ML method: RF

and GBM, also to avoid overfitting and deal with unbalanced data of mixed types,

e.g., categorical vs. continuous. RF is a tree-based ensemble learning method that can

handle categorical variables, continuous variables, or a combination of both (Breiman,

2001). RF constructs a number of ensemble trees, with each tree trained by a randomly

selected subset of input data using a bootstrap aggregating technique. At each node

of a tree, instead of choosing the best split among all predictors, a randomly sampled

subset of predictors is selected, and the best split is chosen from the subset predictors.

Each tree can grow to the maximum possible depth. For classification problems, the fi-

nal prediction is made by the majority votes from all the trees in the ensemble. RF has

been successfully applied to high-dimensionality systems. Examples of its application

10
Table 3: Predictors for the peak hour model.

Predictor Description
load forecast Forecast load for hour t
T* Forecast temperature for hour t
humidity* Forecast humidity at hour t
weekendIdx A binary indicator: 1 if the operating day is on a weekend,
and 0 otherwise
peak prev day A binary indicator: 1 if hour t is the peak hour on the
previous day, and 0 otherwise
T m 1* Forecast temperature for hour t − 1
T m 2* Forecast temperature for hour t − 2
T m 3* Forecast temperature for hour t − 3
T p 1* Forecast temperature for hour t + 1
T p 2* Forecast temperature for hour t + 2
T p 3* Forecast temperature for hour t + 3
load m 1 Forecast load for hour t − 1
load m 2 Forecast load for hour t − 2
load m 3 Forecast load for hour t − 3
load p 1 Forecast load for hour t + 1
load p 2 Forecast load for hour t + 2
load p 3 Forecast load for hour t + 3
prev max load Maximum forecast load from hour 0 to hour t − 1
after max load Maximum forecast load from hour t + 1 to 23
rank load forecast Rank of forecast load for hour t on the operation day
rank load prevDay Rank of actual load for hour t in on the previous day
load prevDay Actual load for hour t on the previous day
load prevDay forecast Forecast load for hour t on the previous day

Algorithm 1 A General RF-based Classification Algorithm


1: Randomly split the total dataset into training and testing (e.g., 75% and 25%)
2: for i = 1 to n tree do
3: Randomly select a subset n out of N samples
4: Randomly select a subset of m predictors out of M factors (x1 , x2 , . . . , xM )
5: Grow a random forest tree Ti and prune it to the optimal depth n depth
6: Output Ti tree forecast Ci (x1 , x2 , . . . , xM ), which is binary)
7: end for
8: Generate RF prediction by the majority vote of all tree forecasts Ci , ∀i =
1, . . . , n tree

in power systems include Lahouar & Slama (2015); Liu, Dong, Hou & Liu (2021). RF

models can be developed and optimized by refining key model configuration parameters

such as the number of trees and tree depths, in addition to bootstrap re-sampling of

subsets and multi-fold cross-validation. A general RL-based classification algorithm is

summarized in Algorithm 1. In addition to estimating the probability of classification,

an RF model also provides measures of relative feature importance of predictors.

GBM is another tree-based ensemble learning method (Friedman, 2001). Unlike

11
RF, in which each tree is trained independently, GBM builds one tree at a time and

the newly-built tree is added to previous trees to improve the overall prediction. It

can be viewed as an iterative numerical optimization process with a goal of finding an

additive model that minimizes the loss function. The new tree at each step is fitted to

the residual of previous trees, and adding a new tree improves regions where previous

trees did not perform well. While the result of RF is voted by all the trees after the tree-

building process, the result of GBM is optimized throughout the tree-building process.

Compared to RF, GBM can be more computationally intensive and more sensitive to

noise in the training data set due to its iterative nature.

LR is a classical statistical ML method that models the relationship between a

set of predictors and a categorical response variable using a logistic function (sigmoid

function) (Stoltzfus, 2011). The predictors of an LR model can be categorical and/or

continuous variables, and the output is the probability of the response variable being

one of the categorical outcomes. Because there are no “hyper-parameters” that can be

used to tune an LR model, it is ideally used as a baseline model in predictive analyses.

3.3. Data augmentation

The raw load data are only available after July 2015, resulting in less than

80 monthly peak days. Separate models by month are highly desirable to better

capture varying load patterns in different months. Therefore, data augmentation

is needed to generate sufficient data for model training and reliable testing. An

ANN model for day-ahead load forecast has been developed using load and weather

attributes(Berscheid, Makarov, Hou, Diao, Zhang, Samaan, Yuan & Zhou, 2018).

The developed model has been cross-validated with historical load and weather data

sets for major U.S. Balancing Authorities. In this study, using the DEP weather and

load data sets from July 2015 to December 2020, the developed ANN model was

trained to predict hourly load (including both actual load and day-ahead forecast) with

the following predictors: hour, temperatures for the current hour and the past 3 hours,

humidity at the hour, day of the week for the predicting day, and weekday/weekend

index. After a hyperparameter search, an optimized ANN model containing two layers

and 20 neurons was obtained to capture load patterns and the relationship between

load and weather embedded in the raw load data. Using the ANN model, we produced

12
hourly actual load and day-ahead hourly load forecast over a 15-year period with

actual weather data from 2000 to 2015.

To validate the ensemble ML model performance, a subset of 6-year data is ran-

domly selected for model testing: 2001, 2006, 2008, 2011, 2019, and 2020. The remain-

ing 15-year data are used for training. Note that the actual weather data are used for

the ML model development because of the lack of historical weather forecast data.

4. Results

4.1. ML predictive model development

4.1.1. Model training

Ensemble ML models, including LR, RF, and GBM, are developed for peak hour

predictions. For LR models, we use Akaike Information Criteria (Akaike, 1974) for

the model selection. For RF and GBM models, we evaluate the testing accuracy with

respect to two hyper-parameters: number of trees and tree depths. Fig. 5 shows the

training and testing accuracy with respect to different tree depths and different numbers

of trees for both January and July RF models. The selected number of depths are 5,

10, 20, 40, and 60, and the selected number of trees are: 50, 100, 200, 500, 1000,

and 2000. The results show that the testing accuracy converges when the tree depths

are greater than 20 for both models. For the January model, the testing accuracy is

comparable when the same number of depth is used regardless of the number of trees

used. For the July model, 1000 trees yield slightly higher accuracy than using other

tree numbers when the tree depth is greater than 20.

4.1.2. Model comparison

For the peak hour models, each of the three ML ensembles is optimized with pa-

rameter search and cross-validation for reducing misfits and overfitting if possible. The

performance of the optimized final models is compared in terms of the overall accuracy

of capturing actual peak hours for each month in the 6 testing years. Overall, the RF

models outperform both the LR and GBM models by 2%, In six monthly models —

January, April, June, July, August, and September — the RF models perform better

than the other two models by 5% and 3%, respectively. LR models perform slightly

better in February, May, October, and December; while GBM models perform better

13
1.00

0.99

0.98

Accuracy
0.97

0.96

0.95

0.94

0 5 10 15 20 25 30 35 40 45 50 55 60
Depth
(a) January

1.00

0.99

0.98
Accuracy

0.97

0.96

0.95

0.94

0 5 10 15 20 25 30 35 40 45 50 55 60
Depth

Training accuracy of different trees


50 100 200 500 1000 2000
Testing accuracy of different trees
50 100 200 500 1000 2000

(b) July

Fig. 5: Peak hour RF model hyper-parameter tuning for January and July.

in March and November. Because RF models perform the best overall, and in the

focus months of January and July in particular, they are selected for further peak hour

predictions and analyses. For the peak day prediction, RF models also perform bet-

ter than or similar to GBM models, and the LR models do not converge due to their

inability to handle imbalanced data sets. Thus, RF models are also selected for peak

day prediction to be consistent with the model choice for peak hour prediction.

4.1.3. Feature importance

Feature importance (Saarela & Jauhiainen, 2021), which can be directly calculated

from the RF model, measures the relative importance of each predictor in the fitted

model. Fig. 6 shows the ranked importance of the eight predictors in the January

and July peak day models. For the January model, T min (the minimum forecasted

temperature) and load max (the maximum forecasted load for the operation day) are

14
0.3 0.3

Feature importance

Feature importance
0.2 0.2

0.1 0.1

0.0 0.0
T_min

load_max

T_max

load_max

T_max

T_min
prev_month_max

T_min_day_2_to_7

prev_MAX

T_max_day_2_to_7

prev_month_max

prev_MAX

T_min_day_2_to_7

T_max_day_2_to_7
weekdayIdx

weekdayIdx
(a) January (b) July

Fig. 6: Feature importance of peak day models for January and July.

the most significant predictors, with almost identical factors and feature importance

values of 0.237 and 0.235, respectively. The other six variables are secondary. For

the July model, load max is more important than the other predictors. Load-related

predictors (ranking from 1 to 3) are slightly more important than temperature-related

predictors (ranking from 4 to 7).

For peak hour predictions, Fig. 7 shows the top-ranked 10 of the 23 predictors with

scaled importance in the January and July RF models. Rand load forecast (the rank

of the load forecast of each hour) is the dominant predictor for both models, and the

feature importance values are 0.362 and 0.207, respectively. Other import predictors

include the load forecast for the January model and the rank load of the previous

day for the July model. To better understand the importance of predictors, one can

refer to our principal component analysis and shrinkage discriminant analyses showing

cross-dependence among predictors and response variables, as provided in Appendix

A.

4.2. Verification of peak day and peak hour predictions

The above ML classification models yield parameter understanding and peak

day/peak hour probabilities. However, in order to use such outputs for a typical BESS

dispatch decision-making, thresholds are needed for finalizing the peak days and peak

hours, considering that 1) the maximum number of charging/discharging cycles should

be less than 100 per year, and 2) the BESS can be charged/discharged up to 2 hours

15
0.4 0.4

Feature importance

Feature importance
0.3 0.3

0.2 0.2

0.1 0.1

0.0 Humidity 0.0


load_m_1

load_p_1

load_m_3

after_max_load

T_p_3

load_m_3

Humidity

load_p_3

load_p_1

load_m_2

load_p_2
load_forecast

prev_max_load

load_forecast
rank_load_forecast

rank_load_forecast
rank_load_prevDay

rank_load_prevDay
(a) January (b) July

Fig. 7: Feature importance of peak hour models for January and July.

Table 4: Comparison of BESS operation cycles and peak days captured between monthly peak day
model and up-to-date peak day model.

BESS operation cycles Captured actual peak days


Year
Direct model Indirect model Direct model Indirect model
2001 64 78 12 12
2006 64 63 11 12
2008 64 72 11 12
2011 68 71 12 12
2019 77 87 12 10
2020 65 83 10 11
Average 67.2 75.7 11.3 11.5

per day. Given the first consideration, peak day prediction is set to be an exceedance

probability (e.g., 3%) as detailed below; and based on the second consideration, peak

hour prediction is the top 2 hours with the highest peak probabilities in the operation

day.

4.2.1. Peak day prediction

After the next operation day is assigned a peak probability by the RF model,

a decision to charge/discharge a BESS on this day can be made by comparing the

predicted peak day probability with a predefined threshold. The BESS would only be

operated if the predicted peak day probability is above the threshold. A starting value

of such a threshold is 3%, with the assumption that any day within a month could

be a peak day. As shown in Table 4, both the direct and modified peak day models

perform well in terms of the number of operation cycles and peak days captured per

16
Table 5: Comparison of predicted probabilities of actual peak days in 2020 between using the direct
and indirect peak day models.

Actual Maximum hourly Direct peak Indirect peak


peak day peak load (MWh) day model day model
1/22 12260 13.0% 25.7%
2/22 12065 24.9% 27.1%
3/1 10194 11.7% 4.5%
4/8 8324 0.5% 3.8%
5/30 9410 8.7% 37.5%
6/29 11606 20.1% 28.0%
7/20 13244 27.1% 33.7%
8/27 12511 21.2% 30.3%
9/3 13027 11.9% 2.9%
10/8 8790 0.8% 8.6%
11/19 10039 35.4% 66.8%
12/9 11625 20.5% 16.4%

year for the 6 testing years. The BESS would be operated for a similar number of

cycles on average, 67 and 76, which are much fewer than the maximum 100 cycles/year

requirement. The average numbers of captured peak days are 11.3 and 11.5 per year,

for the directed and modified peak day models, respectively.

Table 5 shows the predicted peak day probabilities for each month in 2020 using the

direct and indirect peak day models. With 3% as the threshold, the direct peak day

models miss the peak days in April and October, while the indirect peak day models

only miss the peak day in September. As shown in Fig. 1, compared with the historical

peak loads, the maximum peak loads on April 8, 2020 (8324 MWh), and October 8,

2020 (8790 MWh), are at the lower end of the historical peak day loads, which causes

the direct models to assign a less than 1% probability to both days and miss them. In

comparison, the indirect models can still capture these days with assigned probabilities

of 3.8% and 8.6%, respectively. For the peak day on September 3, 2020, the predicted

peak day probability is only 2.9% from the indirect peak day model, although its peak

load of 13,027 MWh is higher than the median historical peak day loads. The reason

for such a low-probability estimate is because the neighboring days have comparable

high load and the forecast peak load on September 3, 2020 (12,251 MWh), is lower

than the actual peak load on September 2, 2020 (12,785 MWh), as shown in Fig. 8,

which shows the forecast and actual daily peak loads in September 2020.

17
14000
12000

Load (MWh)
10000
8000
6000
4000
2000 Forecasted Peak Load
Actual Peak Load
0

01

06

11

16

21

26
9−

9−

9−

9−

9−

9−
−0

−0

−0

−0

−0

−0
20

20

20

20

20

20
20

20

20

20

20

20
Fig. 8: Forecast and actual daily peak load of September 2020.

1.00
RF Model Naive Model
0.95

0.90
Recall

0.85

0.80

0.75

0.70
Mar

Apr

Sep

Oct

Dec
Nov
Jan

Jun

Jul
Feb

May

Aug

Fig. 9: Comparison of prediction recall for each month between RF models and naive models.

4.2.2. Peak hour prediction

Practically, the BESS can be discharged for 2 hours during a peak day; therefore,

the 2 hours with the highest probabilities from the peak hour model prediction in each

day are selected for discharging. The peak hour prediction performance is verified in

two ways: (1) comparing predictions from RF models with the naive model predictions

using day-ahead load forecast; and (2) evaluating the number of captured peak hours

following the proposed peak day identification (e.g., 3% exceedance probability) and

peak hour prediction procedure.

Fig. 9 shows the percentage of peak hours captured (true positives) relative to the

total number of true positives and false negatives, T P/(T P + F N ), in each month for

the 6 testing years. The percentage metric, i.e., recall, is a good measure of classification

model performance for imbalanced data like in this study. For both RF and naive

models, the recall values are highest in December and January and lowest in July and

August. The RF model has better overall performance than the naive model: of the

72 peak hours in the testing data, the RF model captures 67 (93.1%) while the naive

18
Table 6: Annual performance of BESS for 6 testing years using the proposed peak day and peak hour
models.

BESS operation Number of peak Number of peak


Year
cycles days captured hours captured
2001 78 12 10
2006 63 12 12
2008 72 12 12
2011 71 12 11
2019 87 10 9
2020 83 11 11
Average 76 11.5 10.8

model captures 63 (87.5%). In particular, the recall of the RF model for July is two

times higher than in the naive model.

Further evaluation of the entire prediction framework performance is based on the

number of peak days and peak hours captured for all 6 testing years, using a 3%

exceedance probability threshold for peak day prediction and a 2-hour battery dis-

charging time. The results are summarized in Table 6. The average number of peak

hours captured is 10.8 per year for the 6 testing years. All 12 monthly peak hours in

2006 and 2008 are captured. For testing years 2011 and 2020, 11 of 12 peak hours are

captured and the monthly peak hours in May 2011 and September 2020 are missed.

In 2001, peak hours in May and August are missed. In 2019, peak hours in February,

May, and September are missed. The number of BESS charging/discharging cycles is

76 per year on average, ranging from 63 to 87, which meets the 100 cycles or less per

year requirement.

5. Conclusion

In this paper, we presented an advanced ensemble ML framework for predicting

peak days and peak hours to better support BESS dispatch decision-making. The

proposed approach features the probabilistic definition of peak day and peak hour,

a comprehensive set of physical and temporal factors and predictors, nonlinear en-

semble ML model implementation and selection, and data augmentation. With cross-

validation and model comparison, the proposed ML framework has been proven to

work effectively. The study also provided guidance on the model choices and favorable

conditions for applying the proposed approach. The study generated an ML-enabled

dataset including cleaned historical data and derived attributes as exploratory and re-

19
sponse variables. One area of future work is to develop methods to explicitly integrate

mid- to long-term factors into forecast models. Another interesting research direction

is to fully integrate state-of-the-art ML techniques such as ANN and LSTM to improve

the efficiency and accuracy of peak predictions.

Appendix A. Exploratory data analysis of predictor matrix

Appendix A.1. Principal component analysis (PCA)

PCA is performed to quantify cross dependence among predictors and the daily

peak load (daily peak load). As examples, the loading plots for January and July

are provided in Fig. A.10. As can be seen, for the January peak day model, the first

two components can explain about 71% of the total system variance. The maximum

actual load, the forecast maximum load, the minimum temperature, and the maximum

temperature of the operation day contribute the most to the first PC, PC1. As ex-

pected, the maximum actual load has a strong positive correlation with the forecast

maximum load and strong negative correlations with both the minimum and maximum

temperatures. For the July peak day model, the same four variables contribute the

most to PC1: the maximum actual load, the forecast maximum load, the minimum

temperature, and the maximum temperature of the operation day. Positive correla-

tions exist between the maximum actual load and both the minimum and maximum

temperatures for the operation day. The correlation between the maximum actual load

and the maximum load on the previous day is stronger in July than in January.

PCA plots for finer hourly resolution data are provided in Fig. A.11, which shows

that the first two components explain about 76% and 83% of the total variance for

January and July, respectively. Similar to the peak day models, negative correlations

between load-related variables and temperature-related variables are observed in Jan-

uary, and positive correlations are observed in July.

Appendix A.2. Discriminant analysis

The shrinkage discriminant analyses (SDA) are performed to evaluate the ranking

of the parameters for both the peak day and peak hour models. The analysis results are

summarized in Table A.7. The peak day SDA shows that the forecast maximum load

is the dominant predictor for both the winter and summer peak day models. During

the winter season, the forecast minimum temperature for the operation day is the

20
PCA 1 (54.7%)
0.6
0.4
0.2
0.0
−0.2
−0.4
−0.6

PCA 2 (16%)
0.1
0.0
−0.1
−0.2
−0.3
−0.4
−0.5
−0.6

(a) January

PCA 1 (54.3%)
0.5
0.4
0.3
0.2
0.1
0.0

PCA 2 (13.4%)
0.8
0.6
0.4
0.2
0.0
−0.2
−0.4
−0.6
load_max

daily_peak_load

T_min

T_max

prev_month_max

prev_MAX

T_min_day_2_to_7

T_max_day_2_to_7

−0.8

(b) July

Fig. A.10: PCA loading plots of peak day predictors and daily peak load.

second most important predictor, while in the summer season, the forecast maximum

temperature for the operation day becomes the second most important predictor. In

both the January and July peak hour models, the rank of the load forecast for the

predicting hour is the most important predictor. Other important predictors include

the temperature at the operation hour, and whether the predicting hour is the peak

21
PCA 1 (66.0%)
0.3
0.2
0.1
0.0
−0.1
−0.2
−0.3
PCA 2 (10.0%)
0.6
0.4
0.2
0.0
−0.2
−0.4

(a) January

PCA 1 (68.8%)
0.3
0.2
0.1
0.0
−0.1
−0.2
−0.3
PCA 2 (13.8%)
0.6

0.4

0.2

0.0

−0.2
T
load_actual
Humidity
T_m_1
T_m_2
T_M_3
T_p_1
T_p_2
T_p_3
load_m_1
load_m_2
load_m_3
load_p_1
load_p_2
load_p_3
after_max_load
load_forecast

prev_max_load
rank_load_forecast
peak_prev_day

load_prevDay_demand
rank_load_prevDay
load_prevDay_forecast

−0.4

(b) July

Fig. A.11: PCA loading plots of peak hour model predictors for January and July.

hour on the previous day in both models.

22
Table A.7: Top ranked predictors for the peak day and peak hour models from SDA.

Peak day model Peak hour model


Rank
January July January July
1 load max load max rank load forecast rank load forecast
2 T min T max load forecast T
3 prev MAX weekdayIdx T peak prev day
4 T max day 2 to 7 T min peak prev day Tp1
5 prev month max prev MAX rank load prevDay load p 3

23
References

Akaike, H. (1974). A new look at the statistical model identification. IEEE Transac-

tions on Automatic Control, 19 , 716–723.

Berscheid, A., Makarov, Y., Hou, Z., Diao, R., Zhang, Y., Samaan, N., Yuan, Y., &

Zhou, H. (2018). An open-source tool for automated power grid stress level pre-

diction at balancing authorities. In 2018 IEEE/PES Transmission and Distribution

Conference and Exposition (T&D) (pp. 1–5). IEEE.

Bosen, J. F. (1958). An approximation formula to compute relative humidity from dry

bulb and dew point temperatures. Monthly Weather Review, 86 , 486–486.

Breiman, L. (2001). Random forests. Machine Learning, 45 , 5–32.

Cheng, Y.-Y., Chan, P. P., & Qiu, Z.-W. (2012). Random forest based ensemble system

for short term load forecasting. In Proceedings of the IEEE International Conference

on Machine Learning and Cybernetics (pp. 52–56). volume 1.

Cieslak, D. A., & Chawla, N. V. (2008). Learning decision trees for unbalanced data.

In Joint European Conference on Machine Learning and Knowledge Discovery in

Databases (pp. 241–256). Springer.

Domingos, P. (2012). A few useful things to know about machine learning. Communi-

cations of the ACM , 55 , 78–87.

EIA (2021). U.S. electric system operating data. Available:

https://www.eia.gov/opendata/qb.php?category=2123635. Accessed: 10-25-2021.

El-Attar, E., Goulermas, J., & Wu, Q. (2009). Forecasting electric daily peak load

based on local prediction. In Proceedings of the IEEE Power and Energy Society

General Meeting (pp. 1–6).

El Desouky, A., & Elkateb, M. (2000). Hybrid adaptive techniques for electric-load

forecast using ann and arima. IEE Proceedings-Generation, Transmission and Dis-

tribution, 147 , 213–217.

Friedman, J. H. (2001). Greedy function approximation: a gradient boosting machine.

Annals of Statistics, (pp. 1189–1232).

24
Goodwin, M., & Yazidi, A. (2016). A pattern recognition approach for peak prediction

of electrical consumption. Integrated Computer-aided Engineering, 23 , 101–113.

Hong, T., & Fan, S. (2016). Probabilistic electric load forecasting: A tutorial review.

International Journal of Forecasting, 32 , 914–938.

Hong, T., & Wang, P. (2014). Fuzzy interaction regression for short term load fore-

casting. Fuzzy Optimization and Decision Making, 13 , 91–103.

Huang, N., Lu, G., & Xu, D. (2016). A permutation importance-based feature selection

method for short-term electricity load forecasting using random forest. Energies, 9 ,

767.

Jaiswal, J. K., & Samikannu, R. (2017). Application of random forest algorithm on

feature subset selection and classification and regression. In Proceedings of the IEEE

World Congress on Computing and Communication Technologies (WCCCT) (pp.

65–68).

Jiang, Y. H., Levman, R., Golab, L., & Nathwani, J. (2014). Predicting peak-demand

days in the Ontario peak reduction program for large consumers. In Proceedings of

the 5th International Conference on Future Energy Systems (pp. 221–222).

Lahouar, A., & Slama, J. B. H. (2015). Day-ahead load forecast using random forest

and expert input selection. Energy Conversion and Management, 103 , 1040–1051.

Liu, F., Dong, T., Hou, T., & Liu, Y. (2021). A hybrid short-term load forecasting

model based on improved fuzzy c-means clustering, random forest and deep neural

networks. IEEE Access, 9 , 59754–59765.

Liu, J., & Brown, L. E. (2019a). Effect of forecast accuracy on day ahead prediction of

coincident peak days. In Proceedings of IEEE Innovative Smart Grid Technologies-

Asia (ISGT Asia) (pp. 661–666).

Liu, J., & Brown, L. E. (2019b). Prediction of hour of coincident daily peak load. In

Proceedings of the Innovative Smart Grid Technologies Conference (pp. 1–5).

Massaoudi, M., Refaat, S. S., Chihi, I., Trabelsi, M., Oueslati, F. S., & Abu-Rub, H.

(2021). A novel stacked generalization ensemble-based hybrid lgbm-xgb-mlp model

for short-term load forecasting. Energy, 214 , 118874.

25
Niu, D., Wang, Y., & Wu, D. D. (2010). Power load forecasting using support vector

machine and ant colony optimization. Expert Systems with Applications, 37 , 2531–

2539.

NOAA (2021). Local climatological data station details. Available:

https://www.ncdc.noaa.gov/cdo-web/datasets/LCD/stations/WBAN:13722/detail.

Accessed: 10-25-2021.

Ringwood, J. V., Bofelli, D., & Murray, F. T. (2001). Forecasting electricity demand

on short, medium and long time scales using neural networks. Journal of Intelligent

and Robotic Systems, 31 , 129–147.

Ryu, B., Makanju, T., Lasek, A., An, X., & Cercone, N. (2016). A Naive Bayesian

classification model for determining peak energy demand in Ontario. In Smart City

360 (pp. 517–529). Springer.

Saarela, M., & Jauhiainen, S. (2021). Comparison of feature importance measures as

explanations for classification models. SN Applied Sciences, 3 , 1–12.

Saini, L. M. (2008). Peak load forecasting using Bayesian regularization, resilient and

adaptive backpropagation learning based artificial neural networks. Electric Power

Systems Research, 78 , 1302–1310.

Saxena, H., Aponte, O., & McConky, K. T. (2019). A hybrid machine learning model

for forecasting a billing period’s peak electric load days. International Journal of

Forecasting, 35 , 1288–1303.

Sobhani, M., Hong, T., & Martin, C. (2020). Temperature anomaly detection for

electric load forecasting. International Journal of Forecasting, 36 , 324–333.

Stoltzfus, J. C. (2011). Logistic regression: a brief primer. Academic Emergency

Medicine, 18 , 1099–1104.

26

You might also like