Support Vector Machine to Predict Electricity Consumption in the Energy Management Laboratory

Predicted electricity consumption is needed to perform energy management. Electricity consumption prediction is also very important in the development of intelligent power grids and advanced electrification network information. we implement a Support Vector Machine (SVM) to predict electrical loads and results compared to measurable electrical loads. Laboratory electrical loads have their own characteristics when compared to residential, commercial, or industrial, we use electrical load data in energy management laboratories to be used to be predicted. C and Gamma as searchable parameters use GridSearchCV to get optimal SVM input parameters. Our prediction data is compared to measurement data and is searched for accuracy based on RMSE (Root Square Mean Error), MAE (Mean Absolute Error) and MSE (Mean Squared Error) values. Based on this we get the optimal parameter values C 1e6 and Gamma 2.97e-07, with the result RSME (Root Square Mean Error) ; 0.37, MAE (meaning absolute error); 0.21 and MSE (Mean Squared Error); 0.14.


Introduction
Based on several statistical learning theories, support vector machine (SVM) is known as one of the best machine learning algorithms for classification and regression [1,2]. SVM is compared to the results of other powerful data-driven empirical methods such as RBF, IIR-LRNN, ARIMA, and MLP, SVR results obtained outperform or comparable to those provided by other learning machines [3]. The foundation of Support Vector Machines (SVM) has been developed by Vapnik (1995), Support vector machine is motivated by geometric interpretation to maximize margin discrimination and is characterized by the use of kernel functions [4].
Using machine learning with deep learning method to estimate energy consumption in a building [5] and the study predicts electrical consumption for commercial and residential buildings using deep recurrent neural networks are both of these studies illustrate that the start of the trend of applying machine learning to predict the energy sector, such as to predict electricity consumption [6]. the paper, they apply Support Vector Regression (SVR) used to forecast the time it takes to travel a trip and the data is compared with actual road traffic data. they believe that Support Vector Machines have greater generalizability and guarantee a global minimum for a given training data, SVR is believed to work well for time series analysis [7]. Hyper-parameter estimation in Support Vector Machines (SVMr) regression is one of the main problems in applying this type of algorithm to learning problems. This is a hot topic where the latest approaches have shown excellent results in different applications in fields like finance, manufacturing, IoT, etc. Different evolutionary approaches have been tested to hybridize with SVMr, although the most widely used are evolutionary approaches to continuous problems, such as evolutionary strategies or particle swarm optimization algorithms [8].
The need for electricity from year to year continues to increase. In terms of the electricity load sector, households and commercial facilities account for 30% -40% of the total energy demand in developed countries [9]. But not accompanied by the availability of energy sources. So, it is possible for the energy crisis. Research in recent years has focused on future power grids to meet people's needs with smart systems. The future power grid needs a system that can monitor, supervise, predict, schedule, study, and make decisions about energy consumption and production in an electrical load. Therefore, a number of strategies have been proposed to optimize grid performance and include renewable energy sources and storage as an alternative or even primary supply, the main objective of which is to create a flexible energy supply network characterized by twoway flow of electricity and information. In addition to circulating electricity, the system also flows information, this clearly has added value in embedding more computational intelligence into the management of electricity networks such as intelligence in predicting [10]. Future network systems must also be able to analyze the profiles of each user. With the ability to predict future electrical loads, it can be a material to improve performance or efficiency. As able to estimate future electricity costs, austerity policies by way of scheduling after knowing the prediction of electrical load.
Machine Learning is used to study the consumption patterns of electricity at the Energy Management Laboratory. With machine learning algorithm able to adapt the patterns of electricity consumption from week to week. So it can predict a week ahead. Based on the time horizon of prediction, Mocanu et al. Classifies electricity demand forecasts into two categories: (i) prediction of short-term electrical load from one hour to one week, (ii) prediction of long-term electrical load for more than one year [11]. The machine learning method used in this paper is Support Vector Machine (SVM) for the short term. Support Vector Regression (SVR) in other studies has been introduced to solve regression and prediction problems, in that paper they apply Support Vector Regression or SVR for prediction tasks in the financial sector [12]. The proposed work utilizes support vector regression model to predict the number of total number of deaths, recovered cases, cumulative number of confirmed cases and number of daily cases [13]. In that's paper presents a novel methodology for daily maximum temperature prediction, based on a Support Vector Regression approach. The paper is focused on different measuring stations in Europe, from which different meteorological variables have been obtained, including temperature, precipitation, relative humidity and air pressure. Two more variables are also included, specifically synoptic situation of the day and monthly cycle. Using this pool of prediction variables, it is shown that the SVMr algorithm is able to give an accurate prediction of the maximum temperature 24 h later [14]. in other research, support vector machines are used to predict yarn ductility. This study uses kernel techniques in predicting. The kernel used is the Radial Basis Function (RBF). The prediction results are compared with the predictions using the ANN model, and the results show similar performance [15].
There is also in another study, conducted studies to predict the brittleness of stones. in his research using the SVM model to predict the brittleness of stones by using the kernel technique. Different kernels are used to determine the performance model of each kernel. The kernels used include Linear, Sigmoid, Polynomial and Radial Basis Function (RBF). The results of these studies provide information that the comparison between the kernels used which has the highest value is the Radial Basis Function (RBF) kernel [16]. the use of the Radial Basis Function (RBF) kernel and the Support Vector Machine (SVM) is also used in a case in the medical field, they predict related to breast cancer. the use of both results in boosting perform better [17].
In this research Support Vector Machine (SVM) was used to predict electrical load, using eleven weeks of electrical load data in the Energy Management Laboratory to predict the next week. Parameter C and gamma are obtained from iteration results using Gridsearch to find the optimal parameters. parameters are input into the predictor algorithm. Prediction results in the accuracy test using Root Square Mean Error (RSME), Mean Absolute Error (MAE) and Mean Square Error (MSE).

Materials of Research
Several materials of research are needed in this study, i.e. electrical and information system, information system of electrical load, SVM method, and the calculation of accuracy.

Electrical and information system
The electrical system at the Energy Management ITB Laboratory with the source of electricity comes from solar panels and main grid provider in Indonesia (Perusahaan Listrik Negara or PLN). The components of the electrical system comprise Hybrid Energy controllers as regulators and are equipped with a battery system as a source of electricity storage from solar panels. Each component is also connected to a communication channel that transfers the data of each component of the grid system compilers at the Energy Management ITB Laboratory. Electrical loads in the Energy Management Laboratory include electronic devices such as computers, air conditioners, laptops, heaters and some other electronic devices. The schematic diagram of the electrical and information system at the Energy Management Laboratory is shown in Figure 1 the electrical load starts from the electrical load measurement sensor that generates the data. The data is stored by local data storage. In addition to being stored in local data storage, data is also stored with a centralized database system. The local device is not only for storing data but also functions as a transfer device to a centralized database system. The block diagram of data flow is shown in Figure 2.  Figure 2 illustrates the scheme of electrical load readout data to the storage system using the database system. So with the monitoring system, all electrical activity in the Energy Management Laboratory is recorded automatically in a system.

Support Vector Machine (SVM)
The supporting vector machine (SVM) includes a method of classification and regression where the method works based on learning data that can be used to predict new data or data to be calculated. The SVM method is divided into two parts namely the classification of supporting vectors (SVC) for problems requiring classification techniques and regression of support vectors (SVR) used in the case of regression.
The learning process at SVM aims to derive a hypothesis of the best dividing field that not only minimizes the average error in the training data, but also has good generalizations. Generalization is the ability of a hypothesis to classify or regression data that is not contained in the training data correctly. To ensure this generalization, SVM works on the principle of structural risk minimization (SRM). SRM aims to guarantee the upper limit of generalization on test data by controlling the capacity (flexibility) of the learning result hypothesis. The valuation of margin is shown in Figure  3. . + ≥ +1 = +1 .
With w is the normal plane and b is the position of the field relative to the center of the coordinate. The margin value between the bounding plane based on the formula of the distance to the center is This margin value is maximized by still satisfying the Eq. (1). By multiplying b and w by a constant, a margin value is multiplied by the same constant. Therefore, the constraint of Eq. (1) is a scaling constraint that can be satisfied by rescaling b and w. Then the best discovery of the splitter field with the greatest margin value can be formulated into the constraint optimization problem is shown in Eq. (2).
The type of Eq. (2) is called quadratic optimization problem. The solution of this mathematical problem is very important to determine the conclusion of the predetermined results [18]. In this study, SVM uses the Support Vector Regression method in predicting electrical loads, so giving training vector ∈ ℝ , = 1, … , for vector ∈ ℝ − Support Vectror Regression solve the following major problems is shown in Eq.
Based on here, penalize samples whose predictions are at least ε far from the true target. electrical load sample data penalizes objectives with ζ or ζ , depending on whether their prediction is above or below the tube ε. support vector regression for dual problems is shown in Eq. (4).
where e is the vector of all ones, Q is an n by n positive semidefinite matrix, ≡ ( , ) = ( ) ( ) s the kernel. Here training vectors are implicitly mapped into a higher (maybe infinite) dimensional space by the function ϕ [12]. So, the prediction is shown in Eq. (5).
In this paper using the Radial Basis Function (RBF) kernel. The RBF kernel the function is shown in Eq. (6).
In training using SVM, especially using the RBF kernel, C and gamma parameters need to be considered. for parameter C is commonly used for all Support Vector Machines (SVM). A low C makes the decision surface smooth, while a high C aims at classifying all training examples correctly and gamma defines how much influence a single training example has, The larger gamma is, the closer other examples must be to be affected [19]. SVM used in this research uses sklearn based programming using python. In this paper, in determining the C and gamma parameters using GridSearch. GridSearch helps iterate to find the suit C and gamma parameters according to the training data used in this study. Gridsearch uses a library in Sklearn that runs in python language.

Calculation of accuracy
The results of the Support Vector Machine (SVM) are assessed for their level of accuracy. In this paper, the results of the prediction of electrical load using the SVM method are measured for accuracy using three methods, namely (i) Root Square Mean Error (RSME) is shown in Eq.   Figure  4, it can be explained, that the prediction of electrical load using the Support Vector Machine method and calculate the accuracy value.

Result and Discussion
The result of this research is information technology in the electricity sector. The algorithm created predicts electrical loads using SVMs based on historical data in the database. In determining the prediction of electrical load profile requires data training. Data training is the data used by the algorithm to be studied in order to get the prediction of electrical load. In this case the electrical data is taken from the Energy Management Laboratory's database. Data collection in plot every week. The number of weeks the data took was eleven weeks. Consideration of the weekly taking is the pattern of electricity consumption has a pattern from start Monday, Tuesday, Wednesday to Sunday with data the amount of Azam Zamhuri Fuadi, Irsyad Nashirul Haq, Edi Leksono RESTI Journal (System Engineering and Information Technology) Vol. data used is 12 weeks in hours. So that the total data used for training data is 2016 data. The following in Figure 5 is a graph of electricity consumption for one week and as many as eleven weeks in plot. The display of information data of electricity load in the Energy Management Laboratory is shown in Figure 5.
The data profile of load electrical obtained from electrical load monitoring system and the GridSearch is a method to determine the optimal value of a parameter. Which is the result of the gridsearch method as input for SVM. In this paper the SVM method used is SVR. The predictor algorithm is shown in Figure 6. Based on Figure 6 it can be explained, that how the predictor algorithm produces the prediction data of the electrical load profile. In SVM method the required data is data trainning and data testing. Data trainning is the data that will be studied by the machine with algorithms that produce a pattern. So with the pattern learned by the algorithm, the machine can predict the forward pattern. In this paper the machine studied patterns of electrical usage profiles from the previous weeks. From the patterns of previous weeks the machine is able to produce predictive data of the burden of the use of electrical charges in the future or one month ahead.

Results of parameter optimization
In using the SVM method it is necessary to set the values of C and Gamma to produce data that has a good level of trust. In this paper GridsearchCV is used as a tool for obtaining optimal C and Gamma values. GridsearchCV performs a combination iteration between C and Gamma to produce an optimal combination of C and Gamma. So it is expected to produce prediction results with a high level of trust. The display of result of the optimal parameter value is shown in Figure 7.  parameters return a C value of 1e6 and a Gamma value of 2.97e-07. For the distribution of the combination distribution between C and Gamma in Figure VI. The algorithm of the GridsearchCV process is shown in Figure 8. In Figure 8 illustrates how Gridsearch is running. X and y data are data trainning, which is the relationship between X and y to be searched for a pattern. The best pattern is obtained from the optimal C and Gamma values. Determination of parameters done for how wide the parameters to be searched the accuracy value of X and y relationship pattern. With increasingly wide intervals the longer the computation process. But the wider the interval the more know the range of accuracy at certain values in the inteval. Calculations are performed every single parameter value. After one parameter has been replaced with the value of another parameter in a pre-set interval. The result of one parameter value is stored. And visualized in a graph if all the calculations have been completed all parameter values. In the X and Y value relationship algorithms used in this paper, the optimal value of C and Gamma is C 1e6 and Gamma 2.97e-07. Acquisition of C and Gamma values as inputs for predictor algorithms.

Predictor Algorithm
After the C and Gamma values are obtained from the result of gridsearchCV calculation, the C and Gamma values are inputted into the predictor algorithm. The flow chart of the predictor algorithm is shown in Figure  9.
From Figure 9 the data is read and passed to be set to feature X and y. In this paper X and y are the data consumption of electricity expenses in the previous months. The X and Y relationships that form a pattern to predict the power consumption consumption profile in the coming months. Input C and Gamma obtained from gridsearchCV, after which SVM studied patterns of X and y relationships. When the pattern has been obtained, the machine is tested to get prediction data of the consumption load profile of the electricity in the coming months. RSME is also calculated to know how big the error value. The algorithm is terminated in the form of a command to visualize the data to make it more user friendly. The display of result data for an hour compared kWh is shown in Figure 10. Based on Figure 10 it can be explained, that the prediction result data with the x-axis representing the 1st to 168th hour in a week and the y-axis is the value in kWh. In this graph the prediction data is able to study the pattern of electricity use in one week, namely by comparing the graph of the prediction results in Figure 9 (b) and the graph of electricity consumption from the eleven weeks in Figure 3.With the data for training as much as eleven weeks ago. Prediction data is able to follow the load profile pattern of electricity usage in the Energy Management Laboratory.

Accuracy level of predictor algorithm
The prediction algorithm needs to be tested for its accuracy or level of confidence. Testing is done by comparing the prediction results with the actual data for the next week. The comparison data between predicted and actual data is shown in Figure 11.
Blue line is predicted data and Red line is actual data Figure 11. The comparison data between predicted and actual data The comparison of the two data is sought for the value of RSME (Root Square Mean Error) MAE (Mean Absolute Error) and MSE (Mean Squared Error). RSME, MAE and MSE are calculated to evaluate the results of the prediction algorithm. Evaluation of the results obtained for the predictor algorithm for MAE; 0.21 MSE 0.14 and RSME; 0.37. The results are good because from the three aspects of the assessment method, the accuracy of all tends to be close to 0. SVM has been able to provide electrical load prediction information based on historical data available in the laboratory data base. The accuracy results are shown in figure X, by comparing the actual data with the predicted data and the results of the confident value in the above discussion.

Conclusion
From this research can be concluded that from data of information usage of electricity last weeks which have been recorded in system can be used to predict electrical consumption in one week ahead. One method of machine learning is SVM used as a predictor method in this study. In the results chapter, the input parameters inputted to the predictor algorithm using SVM are obtained from the optimization values of C and Gamma, obtained C 1e6 or 10 6 and Gamma 2.97e-7 or 2.97x10 -7 . Predicted results at the level of accuracy or trust by using RMSE. Obtained prediction algorithm with evaluated results have RMSE (Root Square Mean Error); 0.37, MAE (Mean Absolute Error); 0.21 and MSE (Mean Squared Error); 0.14. For further work, increasing the amount of data historian to be used as training data in predicting electricity consumption is needed to improve the accuracy of prediction results.