Electricity Load Forecasting in Smart
Grids Using Support Vector Machine
Nasir Ayub1, Nadeem Javaid1(B
), Sana Mujeeb1, Maheen Zahid1,
Wazir Zada Khan2, and Muhammad Umar Khattak3
1COMSATS University Islamabad, Islamabad 44000, Pakistan
2Farasan Networking Research Laboratory,
Department of Computer Science and Information System, Jazan University,
Jazan 82822-6694, Saudi Arabia
3Bahria University, Islamabad 44000, Pakistan
Abstract. One of the key issues in the Smart Grid (SG) is accurate
electric load forecasting. Energy generation and consumption have highly
varying. Accurate forecasting of electric load can decrease the ﬂuctuating
behavior between energy generation and consumption. By knowing the
upcoming electricity load consumption, we can control the extra energy
generation. To solve this issue, we have proposed a forecasting model,
which consists of a two-stage process; feature engineering and classiﬁ-
cation. Feature engineering consists of feature selection and extraction.
By combining Extreme Gradient Boosting (XGBoost) and Decision Tree
(DT) techniques, we have proposed a hybrid feature selector to mini-
mize the feature redundancy. Furthermore, Recursive Feature Elimina-
tion (RFE) technique is applied for dimension reduction and improve
feature selection. To forecast electric load, we have applied Support Vec-
tor Machine (SVM) set tuned with three super parameters, i.e., kernel
parameter, cost penalty, and incentive loss function parameter. Electric-
ity market data is used in our proposed model. Weekly and months ahead
forecasting experiments are conducted by proposed model. Forecasting
performance is assessed by using RMSE and MAPE and their values
are 1.682 and 12.364. The simulation results show 98% load forecasting
Smart Grid (SG) is an intelligent power system that eﬃciently manages gener-
ation, distribution and consumption of energy by introducing new technologies
in power grids and enable two-way communication between consumer and util-
ity . Energy is the necessity and most valuable asset. The new generation is
attracted towards SG due to the extensive shortage of energy during the sum-
mer. SG manages the generation, distribution and consumption by implementing
diﬀerent techniques on the power grid, utility and demand side. Eﬃcient energy
Springer Nature Switzerland AG 2020
L. Barolli et al. (Eds.): AINA 2019, AISC 926, pp. 1–13, 2020.
2 N. Ayub et al.
utilization can reduce the shortage of energy, minimize the electricity cost. Many
works are performed on diﬀerent problems of SG . At DSM, the home appli-
ances are scheduled using meta heuristic techniques to reduce the electricity cost,
peak to average ratio and achieve an optimal tradeoﬀ between electricity cost
and user comfort .
SG facilitates consumer in reliability and sustainability by providing eﬃcient
energy management. The Smart Meter (SM) made easy to get enough infor-
mation about future energy generation by providing real time-sharing of data
between consumer and utility. It will create a balance between energy generation
and consumption of energy. The consumer takes part in the operations of SG by
shifting the load from on peak hours to oﬀ peak hours and energy preservation
to lessen their power consumption cost [4,5].
With the help of Demand Side Management (DSM), consumers can manage
their energy utilization in an economical fashion. DSM is a program in which
consumer is able to manage their energy consumption pattern, according to the
price declared by the utility. Market competitors have more beneﬁt from the
load forecasting. Several decisions are based on upcoming load prediction, such
as demand, supply management, power generation scheduling, reliability analysis
and maintenance planning .
Eﬃcient generation and consumption of energy is another issue of the energy
sector. Utility maximization is the ultimate goal of user and utility. With the
help of accurate load forecast, energy producers will maximize their cost and
consumer will take beneﬁt of low cost price of purchasing electricity. There is
no proper energy generation strategy in SG. To avoid extra generation, a per-
fect balance is required between the produced and consumed energy. Therefore,
precise load forecast holds more importance for market set-up management .
New England Control Area Independent System Operator (ISO-NE) is a
regional transmission organization, which is managed by independent system
operator. It is responsible for wholesale energy market operations. It supplies
energy to the diﬀerent states of England, including Massachusetts, Maine, Con-
necticut, New Hampshire, Vermont, and Rhodes Island. The analytics in the
paper are formed on large data set of ISO NE. Price is not the only parameter
that aﬀects the load, however, there are some other parameters that also eﬀect
on the electrical load such as temperature, weather conditions etc.
The quantity of real world data is quite large . SG data is surveyed in
detail . The large amount of data provides information to utility to perform
analysis, which leads to more improvement in the markets operation planning
and management. To optimize the demand side of SG, a decision-making method
is needed. A proper decision-making results in the minimization of power loss,
reduction in the electricity cost and PAR in end user . Keeping in mind these
problems, researchers mainly focus on the power scheduling problem. Diﬀerent
optimization techniques are used to solve the power scheduling issue [11,12].
There is a very huge amount of electricity load data referred as big data. Big
data are very complex and large amount of data. Big data analytics make the
extraction of hidden patterns easy, market trends and other valuable information.
Electricity Load Forecasting in Smart Grids Using Support Vector Machine 3
In literature, many techniques are used for load forecasting. The size of data is
very complex and huge, which creates diﬃculty in the training data. Deep Neural
Network (DNN) has the computational power to handle the training of big data.
DNN has the advantage to forecast accurately and handle huge amount of data.
Many forecasting techniques are discussed in the literature. Forecasting tech-
niques can be categorized in three groups, which are data driven, classical and
artiﬁcially intelligent. To forecast, classiﬁer based techniques are used such as
Random forest, naive bayes and ARIMA etc. Artiﬁcial intelligence techniques are
Deep Neural Network (DNN), Artiﬁcial Neural Network (ANN), Shallow Neu-
ral Network (SNN), Particle Swam Optimization (PSO) etc. Aforementioned
techniques are used for forecasting the load or price. Due to automatic feature
extraction and training processes, neural network has an advantage over other
In paper [13–15], SNN has the worst results and have over ﬁt problem. DNN
performs better in forecasting price and load than SNN. In , the author
implemented Restricted Boltzmann Machine (RBM) and Rectiﬁed Linear Unit
(ReLU) for forecasting. RBM is used for data processing and training the data,
while ReLU performs load forecasting. KPCA is used for extraction of features
and DE based SVM for price forecasting in . To forecast cooling load, Deep
Auto Encoders (DAE) are used . DAE performs better in achieving accuracy
and learning the data. DAE is an unsupervised learning method and outperforms
in attaining the good accuracy results.
Gated Recurrent Units (GRU) technique is implemented for forecasting the
pricein. In , Parameter Estimation Method (PEM) is applied to detect
the abnormal behavior of load. GRU beats the Long Short Term Memory
(LSTM) technique in achieving accuracy in price forecasting. Two deep neu-
ral network techniques; Convolutional Neural Network (CNN) and LSTM are
combined for forecasting load . The Hybrid of LSTM and CNN outperforms
in results than CNN and LSTM separately and other several models. DNN mod-
els show better performance in achieving accuracy in the results of forecasting.
SG big data help to ﬁnd the trend of load and cost. It gives help to utility in
making a demand, supply and maintenance plan, which is the basic requirement
for demand supply balance.
Feature engineering is one of the application of the classiﬁer. Two popular
operation are used in feature engineering; selection and extraction. Several meth-
ods are used for feature engineering in electric load. In article [21–24], author
study about the existing techniques of feature engineering to gain suitable fea-
tures from the data. Forecasting accuracy can be improved by the involvement
of big data.
In this article, we highlight the electricity load forecasting problem. The objective
of our work is to predict the accurate electric load forecasting using electricity
load data set. To solve this problem, we have applied SVM classiﬁer to predict
4 N. Ayub et al.
the electricity load. SVM is a classiﬁer that divides the data into appropriate
categories by making a hyperplane between them. The SV part of the classiﬁer
has the advantage to deﬁne the hyperplane between that classes. SVM is a
proﬁcient method, however, the following challenges need to be answered for
better accuracy of electricity load forecasting.
•High computational complexity: SVM has high computational complex-
ity and weak in processing the uncertain data . In electricity load fore-
casting, redundant features in data increase the computational complexity of
SVM in its training processes and also reduces the prediction accuracy.
•Hard to tune parameters: Super parameters of SVM has an eﬀect on
the performance of SVM in forecasting. Those parameters are Cost penalty,
kernel parameter and incentive loss function. It is diﬃcult to ﬁnd the exact
values of these parameters for higher accuracy.
To address the challenges mentioned above, we have proposed a forecasting
model called Hybrid Feature Selection, Extraction and Classiﬁcation (HFSEC).
The HFS part of the model is based on Hybrid XGboost and DTC, feature
extraction process based on RFE and classiﬁcation is based on SVM classiﬁer.
The proposed model implements feature engineering by selecting features regard-
ing time period and dimensionally reduced in of electricity load data features.
The hybrid feature selector uses the combination of two techniques XGboost
and DTC, rather than using one to give a selection of features. Further remov-
ing redundancy in the data, RFE is applied. The actual contribution of this
•A forecasting model is implemented to achieve accurate load forecasting by
using the big data in SG. We have integrated selection, extraction, and clas-
siﬁcation in our proposed model to solve the addressed problem.
•To implement this model, a hybrid selector is proposed by the combination
of XGboost and DTC, which gives us the feature importance and feature
selection control. RFE is used to remove the redundancy from the selected
features. We have also tuned the parameters of SVM to make forecasting
•The forecasting performance of our proposed model performs better. The real
world electricity load data are used in this paper. Extensive simulations are
performed, which shows 98% accurate results.
Our proposed system model consists of four parts: normalizing the data by pre-
processing, training the data, testing the data, an SVM classiﬁer with tuned
parameters and forecasting load data as shown in Fig. 1.
Electricity Load Forecasting in Smart Grids Using Support Vector Machine 5
3.1 Preprocessing Data
Daily system load data are acquired from ISO-NE. The three years system load
data, i.e. January 2015 to December 2017 are used in this article. The data are
divided month wise and similar months load data, i.e. January 2015, January
2016 and January 2017, ﬁrst three weeks of the month are used in the training
process and the last week for testing. All the data are arranged in the same
manner. The data is normalized with maximum values. Data is categorized into
three parts train, test and validate data.
3.2 Training and Forecasting of Data
After preprocessing of data, we obtained training, validation and testing data.
The obtained data are given to SVM for training. The SVM has three layers; the
input layer, hidden layers, and output layer. The tuning parameters, i.e. kernel
parameter set as Radial Basis Function (RBF), cost penalty and gamma values
are set to 27 and 38. These values are ﬁnalized after extensive simulations and
tuning the parameter values. The network predicts step ahead values at each time
step during the training process of SVM. The SVM acquires every arrangement
and updates the network until the preceding time step. The ﬁrst training of a
network of training data is called an initial network. The initial network formed
is tested on validation data. The initial network gains a forecasted value of a
step ahead result. After gaining the forecasting results, the forecasting network
relearns and tunes the network on validation data until the forecasting errors
are reduced to a minimum value. After all, the tuned and ﬁnal network is used
for load forecasting. The steps of implementing model are listed below:
1. The load data are normalized as (F/Max (F)). Load data are divided month
wise and split into categories, train, validation and test.
2. Training data are used for network training and tested on validation data.
Forecasting errors are calculated on validation data.
3. Network is tuned and validation data actual are updated with new data.
4. The network tests on the test data, and weekly ahead load and month ahead
load are forecasted. The forecasting performance evaluation is performed by
RMSE, MAPE, MAE, and MSE.
3.3 Proposed Model
The issue of the load forecasting is accuracy. Many factors aﬀect the electricity
load and makes the classiﬁer training diﬃcult. To improve the accuracy, we have
proposed a network consists of a hybrid feature selector, RFE based extraction
and SVM based classiﬁer as shown in Fig. 1. Parts of the model are listed below.
3.3.1 Hybrid Feature Selector
This section describes the feature selection process of our model. We proposed a
hybrid feature selector, by combing the XGboost, DTC and deﬁned threshold,
6 N. Ayub et al.
i.e. µto control feature selection. HFS consists of two feature evaluators i.e.
X and D. These two evaluators calculate the feature importance separately. In
the feature selection process, the features are selected by joining the feature
importance generated by the two evaluators. Feature selection is based WXand
WD, which can be normalized by
Then the feature selection perform as
drop, W X[Tk]+WD[Tk]≤µ, (3)
WB[Tk] represents the feature importance calculated by evaluator XGBoost,
WD[Tk] shows feature importance given by the DT. µis the threshold controlling
the feature selection. Features have also redundancy among them. To remove
further redundancy and dimension reduction, they sent to RFE.
3.3.2 Feature Extraction-RFE
The feature extraction process is described in this section. The features selected
by HFS are considered to have no irrelevant features, however, it contains redun-
dant features. To reduce dimension and redundancy of features, Recursive Fea-
ture Eliminator (RFE) is applied for removing redundancy. To ﬁnd a suitable
low dimensional embedding, data needs non-linear mapping in electricity load
forecasting. Thus RFE is applied to reduce nonlinear dimension.
Fig. 1. System model
Electricity Load Forecasting in Smart Grids Using Support Vector Machine 7
In order to simulate the performance of our proposed work, we have performed
the simulation with python. The simulator runs on the system Intel Core i3,
4GB RAM and 500GB storage. Daily electric load data of ISO New England
Control Area (ISO NECA) from January 2015 to December 2017 are taken as
input data for the simulator. Simulation results are as follows.
4.1 Feature Selection Using XGBoost and DTC
XGBoost and Decision Tree Classiﬁer (DTC) is applied to calculate the impor-
tance of features with respect to the target, i.e. load system. In feature selection,
every feature sequence has a form as a vector. Every element of the sequence rep-
resents the feature values of diﬀerent time stamps. However, our objective is to
predict the electricity load, which is named “system load” in the data. Features
that have a small eﬀect on the target are removed. XGBoost technique ﬁnds the
importance of features, i.e. importance in numeric values and also the dimension
of features, i.e. true or false and DTC technique shows the grade of the features.
We select the features by taking hybrid of XGBoost and DTC (XGDTC). We
set a threshold for selection of features in hybrid XGDTC i.e. features having
a grade greater than 0.7 in DTC and having a false dimension in XGBoost are
selected as best features. With the increase in threshold, more features will drop
which leads to maximize the training speed and minimize the accuracy. Best
features have the highest value of importance and also have a high eﬀect on the
target feature. The best features are then given to the forecasting engine for load
prediction. Figures 2and 3shows the XGBoost and DTC importances.
Fig. 2. Feature importance using DTC
8 N. Ayub et al.
Fig. 3. Feature importance using XGBoost
4.2 Load Forecasting
The normalized load of three years is shown in Fig.4, which shows diﬀerent
variations among diﬀerent days. This is the description of load data of years
2015 to 2017. Data are split into training and testing, in which training and
testing days are 822 and 274 and given to the forecasting engine for prediction.
0200 400 600 800 1000 1200
Fig. 4. Normalize load of ISO NE January 2015 to December 2017
Electricity Load Forecasting in Smart Grids Using Support Vector Machine 9
Figure 5, describes a load of the month December 2016, December 2017,
January 2016, and January 2017.
510 15 20 25
Fig. 5. Similar months load
There is less change in the load pattern of similar months, i.e. January 2016,
January 2017 and December 2016, December 2017. There is high variation in the
load values of diﬀerent months, i.e. January 2017 and December 2017. Therefore,
ﬁrst three weeks of January 2015, January 2016 up to January 2017 are used to
1 2 3 4 5 6
Pr e d i c t i o n
Fig. 6. January 2017 last week prediction
10 N. Ayub et al.
train the forecasting engine and test on the last week of January 2017. All the
similar months of data are trained in the same pattern.
The forecasted load of the last week of January 2017 is shown in Fig. 6.
Figure 7, illustrates the actual and forecasted load of the month December 2017.
Load forecasting of 9 months is shown in Fig.8(Table 1).
510 15 20 25 30
Pr e d i c t i o n
Fig. 7. One month prediction (Dec 2017)
50 100 150 200 250 300
Fig. 8. Nine months prediction
Electricity Load Forecasting in Smart Grids Using Support Vector Machine 11
Table 1. Attributes of data
Day-Ahead Cleared Demand, comprised of price-sensitive
RT demand Real time demand
DA LMP Day ahead local marginal price
DA EC Energy consumption of day ahead
DA CC Congestion demand of day ahead
DA MLC Day Ahead marginal loss component
RT LMP Real time location marginal price
RT CC Real time congestion component
RT EC Energy component of real time
RT MLC Real time marginal loss component
Dry bulb Dry bulb temperature for weather station corresponding to
the load zone
Dew point Dew point temperature for weather station corresponding
to the load zone
4.3 Performance Evaluation
To evaluate the performance, two evaluators are used; Root Mean Square Error
(RMSE), Mean Average Percentage Error (MAPE). MAPE has the lowest error
value, i.e., 1.682. RMSE has the highest error value, which is not a good result.
The formulas of MAPE and RMSE is given in Eqs.4and 5.
Table 2. Performance evaluators
where Avis the observed test value at time tm and Fvis the forecasted value at
time tm (Table 2).
12 N. Ayub et al.
5 Conclusions and Future Work
In this work, SVM classiﬁer is used to solve the load forecasting accuracy prob-
lem. Forecasting model is based on feature engineering and classiﬁer adjustment.
The forecasting model consists of two stages; feature engineering and SVM clas-
siﬁer. A hybrid of two techniques (XGBoost and DTC) is applied for feature
selection to select the best features among features in input data. After selec-
tion of features by feature engineering, features include some redundancy. New
features are selected after removing the redundancy by using RFE technique,
which has a positive eﬀect on SVM classiﬁer speed and forecasting accuracy.
The performance error metrics are calculated using MAPE and RMSE. SVM
classiﬁer is tuned with three super parameters until the accuracy is achieved.
SVM classiﬁer has 98% accuracy. In the future, other methods can be applied
to improve forecasting accuracy.
1. Kailas, A., Cecchi, V., Mukherjee, A.: A survey of communications and networking
technologies for energy management in buildings and home automation. J. Comput.
Netw. Commun. 2012, 12 (2012)
2. Iqbal, Z., Javaid, N., Iqbal, S., Aslam, S., Khan, Z.A., Abdul, W., Almogren,
A., Alamri, A.: A domestic microgrid with optimized home energy management
system. Energies 11(4), 1002 (2018)
3. Iqbal, Z., Javaid, N., Mohsin, S., Akber, S., Afzal, M., Ishmanov, F.: Performance
analysis of hybridization of heuristic techniques for residential load scheduling.
Energies 11(10), 2861 (2018)
4. Rahim, M.H., Javaid, N., Shaﬁq, S., Iqbal, M.N., Khalid, M.U., Memon, U.U.:
Exploiting heuristic techniques for eﬃcient energy management system in smart
grid. In: 2018 14th International Wireless Communications and Mobile Computing
Conference (IWCMC), pp. 54–59. IEEE (2018)
5. Xiang-ting, C., Yu-hui, Z., Wei, D., Jie-bin, T., Yu-xiao, G.: Design of intelli-
gent demand side management system respond to varieties of factors. In: 2010
China International Conference on Electricity Distribution (CICED), pp. 1–5.
6. Khan, M., Javaid, N., Naseem, A., Ahmed, S., Riaz, M., Akbar, M., Ilahi, M.:
Game theoretical demand response management and short-term load forecasting
by knowledge based systems on the basis of priority index. Electronics 7(12), 431
7. Ahmad, A., Javaid, N., Mateen, A., Awais, M., Khan, Z.: Short-term load forecast-
ing in smart grids: an intelligent modular approach. Energies 12(1), 164 (2019)
8. Wang, K., Yu, J., Yu, Y., Qian, Y., Zeng, D., Guo, S., Xiang, Y., Wu, J.: A survey
on energy internet: architecture, approach and emerging technologies. IEEE Syst.
9. Jiang, H., Wang, K., Wang, Y., Gao, M., Zhang, Y.: Energy big data: a survey.
IEEE Access 4, 3844–3861 (2016)
10. Alam, M.R., Reaz, M.B.I., Ali, M.A.M.: A review of smart homes—past, present,
and future. IEEE Trans. Syst. Man Cybern. Part C Appl. Rev. 42(6), 1190–1203
Electricity Load Forecasting in Smart Grids Using Support Vector Machine 13
11. Zhu, Q., Han, Z., Ba¸sar, T.: A diﬀerential game approach to distributed demand
side management in smart grid. In: 2012 IEEE International Conference on Com-
munications (ICC), pp. 3345–3350. IEEE (2012)
12. Soares, J., Silva, M., Sousa, T., Vale, Z., Morais, H.: Distributed energy resource
short-term scheduling using signaled particle swarm optimization. Energy 42(1),
13. Zhu, Z., Tang, J., Lambotharan, S., Chin, W.H., Fan, Z.: An integer linear pro-
gramming based optimization for home demand-side management in smart grid,
pp. 1–5 (2012)
14. Liu, J., Li, C.: The short-term power load forecasting based on sperm whale algo-
rithm and wavelet least square support vector machine with DWT-IR for feature
selection. Sustainability 9(7), 1188 (2017)
15. Ghasemi, A., Shayeghi, H., Moradzadeh, M., Nooshyar, M.: A novel hybrid algo-
rithm for electricity price and load forecasting in smart grids with demand-side
management. Appl. Energy 177, 40–59 (2016)
16. Wang, K., Xu, C., Zhang, Y., Guo, S., Zomaya, A.: Robust big data analytics for
electricity price forecasting in the smart grid. IEEE Trans. Big Data (2017)
17. Ryu, S., Noh, J., Kim, H.: Deep neural network based demand side short term load
forecasting. Energies 10(1), 3 (2016)
18. Fan, C., Xiao, F., Zhao, Y.: A short-term building cooling load prediction method
using deep learning algorithms. Appl. Energy 195, 222–233 (2017)
19. Kuo, P.-H., Huang, C.-J.: An electricity price forecasting model by hybrid struc-
tured deep neural networks. Sustainability 10(4), 1280 (2018)
20. Moghaddass, R., Wang, J.: A hierarchical framework for smart grid anomaly detec-
tion using large-scale smart meter data. IEEE Trans. Smart Grid 9(6), 5820–5830
21. Zhao, J.H., Dong, Z.Y., Li, X.: Electricity price forecasting with eﬀective feature
preprocessing. In: IEEE Power Engineering Society General Meeting, p. 8-pp. IEEE
22. Qiu, Z.-W.: Mutivariable mutual information based feature selection for electric-
ity price forecasting. In: 2012 International Conference on Machine Learning and
Cybernetics (ICMLC), vol. 1, pp. 168–173. IEEE (2012)
23. Abedinia, O., Amjady, N., Zareipour, H.: A new feature selection technique for load
and price forecast of electrical power systems. IEEE Trans. Power Syst. 32(1), 62–
24. Qian, H., Qiu, Z.: Feature selection using C4.5 algorithm for electricity price pre-
diction. In: 2014 International Conference on Machine Learning and Cybernetics
(ICMLC), vol. 1, pp. 175–180. IEEE (2014)