Short-Term Electricity Price and Load Forecasting
using Enhanced Support Vector Machine and
Mughees Ali1, Zahoor Ali Khan2, Sana Mujeeb1, Shahid Abbas1and Nadeem Javaid 1,∗
1COMSATS University Islamabad, Islamabad 44000, Pakistan
2CIS, Higher Colleges of Technology, Fujairah 4114, United Arab Emirates
Abstract—Accurate load and price forecasting is one of the
crucial stage in Smart Grid (SG). An efﬁcient load and price fore-
casting is required to minimize the large difference among power
generation and consumption. Accurate selection and extraction
of meaningful features from data are challenging. In this paper,
New York Independent System Operator (NYISO) six months‘
load and price data is used for forecasting. Decision Tree (DT)
is used for feature selection and Recursive Feature Elimination
(REF) technique is used for feature extraction. REF technique is
used to remove redundancy from selected features. After feature
extraction, two classiﬁers are used for forecasting. One classiﬁer is
Support Vector Machine (SVM) and other classiﬁer is K-Nearest
Neighbor (KNN). These classiﬁers have different parameters with
some default values. Week ahead load and price forecasting is
performed in this work. Accuracy of modiﬁed SVM is 89.5984%
and modiﬁed KNN is 89.8605% is achieved for load forecasting.
For price, accuracy of modiﬁed SVM is 88.2740% and modiﬁed
KNN is 85.5999%.
Index Terms—Smart Grid, Electricity load forecasting, Elec-
tricity price forecasting, Support vector machine, K-nearest
Traditional Grid (TG) system is combination of several power
system elements like power generation, power transmission
lines and power transmission substations. These systems are
distant from the electricity utilization sectors. Electric power is
carried through power generated sectors to power consuming
areas through long transmission lines. In TG systems, the
power ﬂow is in one direction from generation to customers
through transmission lines. The Smart Grid (SG) system is
a modernized form of the TG system which provides more
secure electrical service as compare to old TG system [
SG provides bidirectional communication between the utility
and electricity users, and vice versa. SG system plays very
important role in order to monitor activities of consumer
electrical power consumption, smart meters, smart homes and
smart substations. Power consumption in different areas is
different. Power consumption depends on different factors
like holidays, weather conditions and many others, therefore
forecasting is very important in order to predict the power
consumption and unit price of any area.
Forecasting is a process which takes input of historical data
in order to make the prediction of future trends or events.
Forecasting provides information about future trends. It shows
the probability of what might happen in the future.
Forecasting techniques are used in for prediction of future
consumption and electricity price [
]. Data analytics
plays a very important role in SG. On the bases of data
analytics, consumers can easily understand the generation of
electric power, transmission and consumption of electric power.
Data analytics in SG also help to monitor consumer electric
appliances preference, grid connected system information and
smart appliances usage at smart homes. Data analytics in SG
may also used to check the electricity theft at every level like
home level, commercial level and industrial level. It also help
to examine the economy of a speciﬁc region or development of
a speciﬁc region. If in a speciﬁc region electricity consumption
is more than some other regions and usage of smart appliances
is more than other region then it means that this speciﬁc region
is more develop and its economy is better than the other one.
Load and price forecasting is divided into four main categories:
ﬁrst one is very short term forecasting, second one is short
term forecasting, third one is medium term forecasting and
forth one is long term forecasting. Very short term forecasting
is for one hour ahead prediction, short term forecasting is for
hours to week ahead prediction, medium term forecasting is
for months to a year prediction and long term forecasting is
longer than a year prediction.
Different classiﬁers are used in SG for the prediction like
Support Vector Machine (SVM) [
], Artiﬁcial Neural Network
], Recurrent Neural Network (RNN) [
] etc. In
proposed model two classiﬁers are used one is SVM and
other is KNN. SVM is applied for classiﬁcation and regres-
sion purposes in literature; therefore, mostly classiﬁcation is
performed through this in this work. SVM performs linear
classiﬁcation very well. SVM uses a kernel trick in order
to select best features and transform the data. On the basis
of this transformation SVM ﬁnds optimal boundary between
possible outputs. It also perform non-linear classiﬁcation very
efﬁciently. Non-linear SVM means that the algorithm calculated
boundary is not a straight line like in linear SVM. Furthermore,
K-Nearest Neighbor (KNN) is applied for classiﬁcation. It
is non-parametric classiﬁer, which means that the model
structure is determined from the data. It is based on the feature
similarity, prediction is just-in-time by calculating similarity
between input and training instances. Both SVM and KNN
have different parameters. In SVM kernel, degree, gamma,
shrinking, probability etc. parameters are used. The parameters
of KNN are: n-neighbors, weights, leaf-size, metric-parameters
etc. All parameters of both classiﬁers have some default values.
Modifying these parametric-default values will enhance the
A. Problem Statement and Contributions
In literature different techniques were used for forecasting.
In this paper SVM and KNN these two techniques are used
for classiﬁcation and consider as benchmark schemes. In [
authors use SVM as benchmark scheme for load forecasting.
], redundancy in features are not discussed. In [
modify SVM and forecast price. In [
] authors use KNN
for forecasting. In [
], authors use KNN and naive Bayes
classiﬁers for energy efﬁciency. Both load and price forecasting
is discussed in this work. Accurate prediction of electricity
consumption and price in the future using smart grid data is
the major objective of the proposed work. There are following
contributions of this paper, which are explained as under:
Using real world electricity load and price dataset of
NYISO New York city, we perform different techniques
(i.e., Decision Tree (DT), RFE, SVM, KNN) which gives
very good prediction results.
Perform feature selection on dataset for the selection of
best feature which give us better accuracy. DT is used for
the selection of features.
After the feature selection, feature extraction is performed.
For feature extraction, RFE technique is used. RFE is
used for removing redundancy from selected features.
For prediction of load and price; two classiﬁers are used,
one is SVM and other is KNN. Parameters of both
classiﬁers are also modiﬁed for better accuracy suing
grid search technique.
II. PRO PO SE D SYS TE M MOD EL
In this section, the proposed system and its working is
explained as visualised through the Fig. 1, where the ﬂow of
short term load and price forecasting is shown. Proposed model
is based on following four main categories: normalization
of the data by preprocessing procedure, training, testing and
classiﬁcation, which are used for load and price forecasting.
A. Dataset Description
Load and price data is acquired from NYISO. NYISO dataset
contain data of different states of United State of America. New
York city data is used in proposed model. The data is in hourly
time series form. The hourly humidity, pressure, temperature,
wind direction, wind speed, load and price data from 01-05-14
to 31-10-14 is available in dataset. Data is divided on hourly
bases of each day. All the data of sixth month is arrange in
same hourly manner.
B. Feature Engineering
Six months of data load and price data is used for forecasting.
In preprocessing of data, dataset is divided into following two
main parts: one is training data part while other is testing part.
The ﬁrst part is utilized for performing training of our model
while second part is used for testing our model.
Feature selection is most important step for relevant feature
selection. Dataset contain different values, some values are
relevant to our requirement while some values are not relevant.
It is necessary to select relevant features from dataset. For this
purpose feature selection technique is used. In proposed model
DT is used for feature selection process. Data is categorized
into train and test data.
After feature selection, feature extraction is performed using
RFE technique. Redundancy in data increases computational
complexity. Therefore feature extraction technique is used for
the removal of data redundancy.
For forecasting, historical data is used as input and future
trends are predicted on the basis of this data. In proposed model,
two different forecasting techniques are used. One is SVM
and other is KNN. In SVM kernel, degree, gamma, shrinking,
probability and some other parameters are used. In KNN n
neighbors, weights, leaf size, metric params and some other
parameters are used. All parameters of both classiﬁers have
some default values. Modifying these parametric-default values
will enhance the classiﬁers efﬁciency. Week ahead price and
load forecasting is based on the previous load and price data.
In order to forecast next week load and price, previous months
data is used. In dataset, the column name ‘Load’ is set as target
value for load and ‘Price’ is set as target for price forecasting.
75% of the dataset is applied for training of model while 25%
is utilized for testing of the model.
Now, performing SVM and KNN separately for Load and Price
forecasting. Both classiﬁers have different parameters and these
parameters have different default values. By modifying these
parametric values accuracy of classiﬁer enhanced. After that
perform modiﬁcation on SVM and KNN for better accuracy
of load and price forecasting.
III. SIMULATION RESULTS
In this section, we have discussed the results of load and
price forecasting, which are achieved through our proposed
system and the existing models.
A. Results of Price forecasting
All the simulations are performed using Python platform on
a computer system Intel core i7 processor with 8 GB RAM
and 500 GB hard disk. Price forecasting results are shown
Scheme 1: SVM for Price forecasting: First technique used
for price forecasting is SVM. Before forecasting, feature
importance is evaluated. The feature importance is shown in
Fig. 2. The data is normalized for obtaining prediction results
Load and Price
Fig. 1: Proposed Model
Fig. 2: Feature Importance
of SVM model.
Scheme 2: KNN for Price Forecasting: Fig. 3 shows the
normalized price data of both SVM and KNN. Fig. 4 shows
the predictive price data of both SVM and KNN.
Modiﬁed scheme: SVM and KNN for Price Forecasting:
Now performing parametric modiﬁcation on both classiﬁers
are implemented and studied on dataset. Perform normalization
on price data using Modiﬁed SVM and KNN. Fig. 5. shows the
normalized price data of both Modiﬁed SVM and KNN. After
normalization, week ahead price prediction is performed using
Modiﬁed SVM and KNN. Fig. 6. shows the predictive price
Fig. 3: Normalized Data by SVM and KNN
Fig. 4: Predictive Data by SVM and KNN
Fig. 5: Normalized Data for Modiﬁed SVM and KNN
Fig. 6: Prediction Data by Modiﬁed SVM and KNN
data of both Modiﬁed SVM and KNN. Simulation results depict
that modiﬁcation enhances the accuracy of both classiﬁers as
Modiﬁed SVM shows 89.59% accuracy and 89.86% accuracy
is shown by the Modiﬁed KNN.
Mean Absolute Error (MAE), Root Mean Square Error
(RMSE) and Mean Average Percentage Error (MAPE) for
performance evaluation. Table I shows the performance evalu-
ator of Modiﬁed SVM and Modiﬁed KNN.
IV. RES ULT S OF LOA D FORECASTING SCHEME
The load forecasting results of SVM, KNN, enhanced SVM
and enhanced KNN are shown below.
Scheme 1: SVM for Load forecasting: First technique used
for price forecasting is SVM. Before forecasting, feature
importance in the calculated. After the feature importance
as shown in Fig. 7 perform normalization on the price data
using SVM. Fig. 8. shows normalized price data using SVM.
Scheme 2: KNN for Load Forecasting:
Modiﬁed scheme: SVM and KNN for load forecasting: Now
performing parametric modiﬁcation on both classiﬁers and
implement on dataset. Fig. 9 shows the normalized load data
of both Modiﬁed SVM and KNN. Fig. 10 shows the predictive
load data of both Modiﬁed SVM and KNN. Modiﬁcation
enhances the accuracy of both classiﬁers 88.27% is shown
by Modiﬁed SVM and 85.55% by Modiﬁed KNN The
Fig. 7: Normalized Data by SVM and KNN
Fig. 8: Predictive Data by SVM and KNN
Fig. 9: Normalized Data by Modiﬁed SVM and KNN.
TABLE I: Performance Evaluator values of modiﬁed SVM and KNN.
Evaluator Modiﬁed SVM Value Modiﬁed SVM Value KNN Value
MAE 13.6340 11.0688
RMSE 11.68613 13.3133
MAPE 6.402 5.139
Fig. 10: Predictive Data by Modiﬁed SVM and KNN.
performance evaluator: MAE, RMSE and MAPE are used
to validate the performance of proposed techniques. Table II
shows the performance evaluator of Modiﬁed SVM and KNN.
Table II shows that modiﬁcation in the parameters of the SVM
and KNN enhance the overall performance and accuracy of
the SVM and KNN.
TABLE II: Performance evaluator of modiﬁed SVM and KNN
Evalutor Modiﬁed SVM value Modiﬁed KNN value
MAE 11.58297 12.8663
RMSE 14.5103 16.2073
MAPE 11.726 14.400
This work has proposed and implemented the load and
price forecasting. The sole purpose of the proposed work is to
increase the forecasting accuracy. NYSIO dataset is used to
predict the price and load of electricity. Feature selection and
extraction are performed. Further, two enhanced classiﬁers
are used: SVM and KNN. These classiﬁers are enhanced
by modifying the above-mentioned parameters. Accuracy of
modiﬁed SVM is 89.59% and modiﬁed KNN is 89.86% for
Stephens, Jennie C., Elizabeth J. Wilson, and Tarla Rai Peterson. “Smart
grid (R) evolution. ”Cambridge University Press, 2015.
Kun Wang, Chenhan Xu, and Song Guo. “Big Data Analytics for Price
Forecasting in Smart Grids.”2016 IEEE: 978-1-5090-1328-9/16.
Yang Liu, Wei Wang, Noradin Ghadimi, “Electricity load forecasting by
an improved forecast engine for building level consumers.”0360-5442/
2017 Elsevier. http://dx.doi.org/10.1016/j.energy.2017.07.150.
Yinghao Chu, Carlos F.M. Coimbra. “Short-term probabilistic
forecasts for Direct Normal Irradiance.”0960-1481/ 2016 Elsevier
Chuan Choong Yang, Chit Siang Soh, Vooi Voon Yap. “A systematic
approach in appliance disaggregation using k-nearest neighbours and
naive Bayes classiﬁers for energy efﬁciency.”Springer Science+Business
Media B.V. 2017.
Fan, Cheng, Fu Xiao, and Yang Zhao. “A short-term building cooling
load prediction method using deep learning algorithms.”Applied energy
195 (2017): 222-233.
Liu, Jin-peng, and Chang-ling Li. “The short-term power load forecasting
based on sperm whale algorithm and wavelet least square support vector
machine with DWT-IR for feature selection.”Sustainability 9, no. 7 (2017):
Kuo, Ping-Huan, and Chiou-Jye Huang. “An Electricity Price Forecasting
Model by Hybrid Structured Deep Neural Networks.”Sustainability 10,
no. 4 (2018): 1280.
 Moghaddass, Ramin, and Jianhui Wang. “A hierarchical framework for
smart grid anomaly detection using large-scale smart meter data.”IEEE
Transactions on Smart Grid, 2017.
Amber KP, Aslam MW, Hussain SK. “Electricity consumption forecast-
ing models for administration buildings of the UK higher education
sector.”Energy and Buildings. 2015 Mar 1;90:127-36.
Guangzhong Dong, Member, IEEE, and Zonghai Chen, Member, IEEE.
“Data Driven Energy Management in a Home Microgrid Based on
Bayesian Optimal Algorithm.”1551-3203 : 2018 IEEE.
Xishuang Dong, Lijun Qian, Lei Huang. “Short-Term Load Forecasting in
Smart Grid: A Combined CNN and K-Means Clustering Approach.”978-
1-5090-3015-6/17 2017 IEEE.
Peter Lusisa, Kaveh Rajab Khalilpour, Lachlan Andrew, Ariel Liebman.
“Short-term residential load forecasting: Impact of calendar effects and
forecast granularity.”0306-2619/ 2017 Elsevier.