Keywords

1 Introduction

The short-term load forecasting of the power system is an important basis for the safe and economical operation of the power system. With the introduction of the price competition mechanism into the power system to form the power market, higher requirements are put forward for the accuracy and response speed of short-term load forecasting. Although the power system load forecasting has been studied for many years, many theories and methods of load forecasting have been formed [1,2,3], but with the development of new load forecasting theories and technologies, the theoretical research on new load forecasting methods is still developing [5, 6]. As a new technology of data mining, support vector machine theory is applied in the fields of pattern recognition [4, 7] and dealing with regression problems. In this paper, using the good nonlinear learning and prediction characteristics of the support vector machine theory, aiming at the nonlinear characteristics of various influencing factors of the short-term load forecasting of the power system [8, 9], the short-term load forecasting method of the power system based on the support vector machine theory is studied [10, 11], which have important theoretical significance and practical value.

2 Sample Selection and Preprocessing for Load Forecasting

SVM-based power system load forecasting problem is to find a mapping from the factors that affect the load to the load with wide applicability. In fact, the performance of load forecasting models constructed with intelligent algorithms depends on the quantity and quality of historical load data [12]. The SVM based on the machine learning method needs to train the training samples first, and then use the trained network to make predictions, and the accuracy and generalization ability of the prediction model are easily affected by the input variables of the samples. Therefore, the selection of input variables becomes a power The key to system load forecasting data preprocessing [13]. The comprehensiveness of the data is crucial to the effect of the forecast. The data in this paper selects the power grid operation data provided by East-Slovakia Power Distribution Company as the research object, that is, the data includes the daily average of the four years from 1995 to 1998 and January 1999. Temperature. According to 1997, 1998 and January 1999 load sampling data at equal intervals of 30 min within 24 h a day, the historical data in 1997 and 1998 were used as training samples, and the data in January 1999 was regarded as unknown data, and the daily maximum value in January 1999 was calculated. Load Forecasting.

2.1 Feature Selection of Samples

Short-term load forecasting of power system is a multivariate forecasting problem, which is studied as a functional regression problem. The predicted load value \(y\) is the output value of the function, and the corresponding factors affecting the load, such as historical load, temperature information, meteorological information, etc., are used as the input value of the function \(x\). Each component of the training data is the feature quantity of the SVM (each element in the input vector of the \(x\) sample set (\(x\), \(y\)) is called a feature). The different data sequences affect the model's scheme, which in combination with the magnitude of the correlation and the data determines the model for the input samples. The data features selected in this paper are: load time series, time factors, and the impact of temperature on load.

2.2 Determination of Training and Testing Samples

In the short-term load forecasting algorithm of power system based on SVM, many researchers have done a lot of work and used a variety of methods to determine the feature quantity of the sample. Principal component analysis (PCA), as a commonly used method to solve the problem of input variable selection [14], is relatively simple and easy to understand in theory and application. It can not only compress the sample space and improve the efficiency of prediction, but also eliminate the reduction of the generalization ability of the prediction model caused by the correlation between variables, thereby effectively improving the prediction accuracy of the model.

Based on the work done by previous researchers and after analyzing historical data, this paper determines the following sample input sizes:

  1. (1)

    Daily maximum load data L = {l1, l2, l3, l4, l5, l6, l7} 7 days before the forecast date;

  2. (2)

    The daily average temperature of the \(T\) forecast day;

  3. (3)

    The weekly attribute W = (1, 2, 3, 4, 5, 6, 7) of the forecast day, where the values correspond to Monday to Sunday;

  4. (4)

    The holiday attribute F = (1.0, 0.0) of the forecast day, and its value is 1 to indicate that the forecast day is a major holiday.

The input sample is a 10-dimensional vector L = {l1, l2, l3, l4, l5, l6, l7, T, W, F}, and the historical data is smoothed and normalized to form a sample set containing 723 samples.

  1. (1)

    Normalize the historical samples to form the SVM training sample set; the objective function [15] of formula (1) according to the training sample set;

  2. (2)

    Dual optimal problem:

    $$\mathop {\max }\limits_{{\alpha ,\alpha^{ * } }} \mathop {\min }\limits_{{w,b,\varsigma ,\xi^{ * } }} L = - \frac{1}{2}\sum\limits_{i,j = 1}^{l} {(\alpha_{i} - \alpha_{i}^{ * } )(\alpha_{j} - \alpha_{j}^{ * } )} \langle x_{i} ,x_{j} \rangle$$
    (1)
    $$- \varepsilon \sum\limits_{i = 1}^{l} {(\alpha_{i} + \alpha_{i}^{ * } )} + \sum\limits_{i = 1}^{l} {y_{i} } (\alpha_{i} - \alpha_{i}^{ * } )$$
    $$S.T\left\{ \begin{gathered} \sum\limits_{i = 1}^{l} {(\alpha_{i} ,\alpha_{i}^{ * } )} = 0 \hfill \\ \alpha_{i} - \alpha_{i}^{ * } \in [0,C] \hfill \\ \end{gathered} \right.$$

    Introducing the kernel function to solve the above equation, we get

    $$\left\{ \begin{gathered} w = \sum\limits_{i = 1}^{l} {(\alpha_{i} - \alpha_{i}^{ * } )} \varphi (x_{i} ) \hfill \\ f(x) = \sum\limits_{i = 1}^{l} {(\alpha_{i} - \alpha_{i}^{ * } } )k(x_{i} ,x) + b \hfill \\ \end{gathered} \right.$$
    (2)

    The threshold b can be calculated by the following formula:

    $$b = averge\left| {\varepsilon sign(\alpha_{i} - \alpha_{i}^{ * } ) + y_{i} - \sum\limits_{i = 1}^{l} {(\alpha_{i} - \alpha_{i}^{ * } )} k(x_{i} ,x)} \right|$$
    (3)
  3. (3)

    Substitute the number- insensitive loss parameter \(\varepsilon\), penalty coefficient \(c\) and the width parameter in the kernel function \(\sigma^{{2}}\) into Eq. (1), and solve for \(\alpha_{i}\), \(\alpha_{i}^{ * }\);

  4. (4)

    Insert \(\alpha_{i}\) and \(\alpha_{i}^{ * }\) enter into formula (4), and use the forecast sample to complete the forecast of the maximum load on the next day;

    $$\tilde{f}(x_{t + 1} ) = \sum\limits_{i = 1}^{l} {(\alpha_{i} - \alpha_{i}^{ * } )} k(x_{i + 1} ,x) + b$$
    (4)
  5. (5)

    After the forecast is completed, the real load data of the next day is regarded as the known data, and the load forecast for the whole month is completed in turn. In order to verify the effectiveness of the algorithm, this paper takes the average relative error as the basis for evaluating the prediction effect, that is,

    $$e_{MAPE} = \frac{1}{n}\sum\limits_{i - 1}^{n} {\left| {\frac{A(i) - F(i)}{{A(i)}}} \right|} \times 100\%$$
    (5)

\(A(i)\) and \(F(i)\) represent the actual and predicted load values, respectively.

3 Normalization of Load Data

After obtaining all training samples and test samples, the input sample data is usually normalized due to the following factors:

  1. (1)

    Avoid data that changes in a larger range from drowning data that changes in a smaller range.

  2. (2)

    Avoid numerical difficulties in calculation, because the inner product of eigenvectors needs to be calculated in kernel value calculation, such as linear kernel and polynomial kernel, etc. Large eigenvalues may cause numerical difficulties.

Normalization in this paper is carried out according to the dimension, that is, each dimension of the 10-dimensional input vector is normalized to the required interval. Assuming that the maximum value of the current dimension on all samples is and the \(\max\) minimum value is \(\min\), the following linear transformation can be done:

$$y = \frac{x - \min (value)}{{\max (value) - \min (value)}}$$
(6)

\(x\), \(y\) are the values before and after the \(\max (value)\) transformation, and \(\min (value)\) are the maximum and minimum values of the sample, respectively, so that the [min, max] interval is mapped to the [0, 1] interval; similarly, the data can also be normalized to map to The interval [−1,1], this process can be completed by the normalization function of matlab.

4 Methods of Kernel Function Construction, Selection and Parameter Optimization

The choice of kernel function has a great influence on the accuracy of load forecasting. According to related research, this paper chooses RBF as the kernel function of SVM. Through a large number of experimental studies, it is found that the width parameter \(\sigma^{2}\) and penalty coefficient in the kernel function \(c\) play a very important role in the performance of SVM [16].

SVM has a great influence on the performance of the model. At present, there is no recognized effective structured method for the parameter selection of SVM. Due to the large amount of data in training samples, this paper only optimizes two parameters that are critical to the performance of \(\sigma^{2}\) SVM, namely the width parameter and the penalty coefficient in the kernel function \(c\). In order to ensure the efficiency and practicability of the calculation, this paper adopts the grid -search and cross-validation method (Grid-search) to select the width parameter \(\sigma^{2}\) and penalty coefficient in the kernel function \(c\).

Cross Validation (Cross Validation, CV) is a statistical analysis method used to verify the performance of the classifier. The basic idea is to group the original data (dataset) in a certain sense, and part of it as a training set (train set), and the other part is used as the validation set. First, use the training set to train the classifier, and then use the validation set to test the trained model (model), which is used as the performance indicator for evaluating the classifier. The commonly used CV method is \(k\) fold cross validation (\(k\)-fold Cross Validation), denoted as \(k\)-CV. Cross-validation and parameter optimization are two steps. Their relationship is that in the process of parameter optimization, each time a new parameter value is obtained, cross-validation is required to verify.

to determine the optimal value on a two-dimensional uniformly divided grid composed of the width parameter \(\sigma^{2}\) and the penalty coefficient. The parameter optimization and cross-validation process for load forecasting \(c\) with SVM is shown in Fig. 1 and Fig. 2:

Fig. 1.
figure 1

The first iteration process of cross-validation

Fig. 2.
figure 2

The second iteration process of cross-validation

Now, SVM is used to predict the load in the case of selecting parameters and not selecting parameters. The specific values can be seen in Fig. 3.

From the checking results in Table 1, it can be concluded that the prediction accuracy after using the optimal parameters is significantly improved, and the selection of parameters has a greater impact on the load prediction effect.

Fig. 3.
figure 3

Comparison of prediction results

Now the load prediction results of the power system based on SVM and the real results are drawn in Fig. 4. After calculation, \(e_{MAPE}\) = 1.8937%, the accuracy is high.

Fig. 4.
figure 4

Prediction results

5 Summary

This paper focuses on the key sample selection and preprocessing problems in the load forecasting model of the SVM method. This paper shows that the support vector machine theory (SVM) can better solve practical problems such as small samples, nonlinearity, high dimensionality and local minima. Problem, and can be used to establish a more complete load forecasting model. And make the following conclusions:

  1. (1)

    This paper provides a basis for the selection of sample input feature quantities through the research on the correlation between the selected historical load data and the predicted load data, and gives a sample set selection scheme.

  2. (2)

    This paper also studies other issues such as data preprocessing, kernel function construction and selection, parameter optimization methods, data normalization processing, etc., and uses examples to analyze the results of short-term load forecasting based on SVM under each sample processing condition.

  3. (3)

    In this paper, SVM is used for power system load forecasting, which has the advantages of high accuracy and fast speed, and significantly improves the effect of load forecasting.

  4. (4)

    Before establishing the sample set, various mathematical methods will be used to correct the bad data in the historical load value. Even so, there is still a deviation between the corrected value of the bad data and its actual value, which directly affects the prediction accuracy. How to deal with bad data more effectively needs to be further explored.