# Short-Term Power Prediction of Wind Turbine Applying Machine Learning and Digital Filter
## 3 Time Series Forecasting Experiments
### Presentation of Prediction Results and Analysis
#### 3.5.2 Single-Step Prediction  
Machine-learning models perform time series prediction through a supervised learning framework. This training process requires using data from the training set as samples to learn from to obtain the patterns of variation in them. The output in the training set in this study is smoothed by a digital filter in pre-processing, which is equivalent to giving the machine-learning model a noise-filtering learning paradigm so that it can also output noise-reduced results in the prediction phase. In order to determine the appropriate data frame length of the SG filter, filters of order 2 (N = 2) but with progressively increasing frame length (M = 1-15, frame length = 2M + 1 = 3-31) were used for comparison in this study (Table 3). A data frame length of 5 and a polynomial order of 2 are the most effective filtering parameters (MD2 in Table 3). For the model that also used a second-order digital filter, the prediction error was not the same because the setting of the frame length changed the degree of smoothing. Values that are too small resulted in ineffective removal of noise (MD1), and values that are too \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Model** & **MSE** & **RMSE** & **MAE** & **SMAPE/\%** & \(\mathbf{R^{2}}\) & **Time/s** \\ \hline LSTM & **61,211.25** & **247.40** & 150.92 & **56.34** & **0.96** & 5262 \\ BiLSTM & 72,940.68 & 270.07 & 161.03 & 57.31 & 0.95 & 7639 \\ GRU & 66,200.80 & 257.29 & **150.82** & 58.27 & 0.96 & 4503 \\ RNN & 148,230.00 & 385.00 & 283.30 & 70.56 & 0.91 & 3064 \\ simpleRNN & 91,431.48 & 302.37 & 222.81 & 62.09 & 0.94 & **1402** \\ \hline \hline \end{tabular} The better values for each indicator are marked in bold.  
\end{table} 
Table 2: Performance comparison of basic neural network models. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Model** & **RMSE** & **MAE** & **SMAPE/\%** & \(\mathbf{R^{2}}\) \\ \hline LSTM & 247.40 & 150.92 & 56.34 & 0.96 \\ BiLSTM & 270.07 & 161.03 & 57.31 & 0.95 \\ GRU & 257.29 & 150.82 & 58.27 & 0.96 \\ RNN & 385.00 & 283.30 & 70.56 & 0.91 \\ simpleRNN & 302.37 & 222.81 & 62.09 & 0.94 \\ Md1 (N = 2, M = 1) & 281.25 & 169.78 & 39.60 & 0.96 \\ Md2 (N = 2, M = 2) & **115.52** & **70.76** & **32.27** & 0.99 \\ Md3 (N = 2, M = 3) & 153.50 & 104.54 & 36.81 & 0.99 \\ Md4 (N = 2, M = 4) & 170.99 & 103.11 & 34.70 & 0.98 \\ Md5 (N = 2, M = 5) & 187.61 & 116.96 & 36.09 & 0.98 \\ Md6 (N = 2, M = 6) & 202.78 & 122.27 & 38.39 & 0.98 \\ Md7 (N = 2, M = 7) & 215.09 & 130.58 & 38.24 & 0.97 \\ Md8 (N = 2, M = 8) & 226.97 & 139.54 & 37.13 & 0.97 \\ Md9 (N = 2, M = 9) & 236.80 & 144.91 & 38.96 & 0.97 \\ Md10 (N = 2, M = 10) & 248.04 & 151.02 & 40.06 & 0.97 \\ Md11 (N = 2, M = 11) & 258.54 & 160.96 & 39.03 & 0.96 \\ Md12 (N = 2, M = 12) & 266.47 & 161.88 & 40.73 & 0.96 \\ Md13 (N = 2, M = 13) & 273.91 & 169.60 & 40.80 & 0.96 \\ Md14 (N = 2, M = 14) & 282.26 & 182.46 & 40.31 & 0.95 \\ Md15 (N = 2, M = 15) & 285.25 & 175.56 & 40.97 & 0.95 \\ \hline \hline \end{tabular} The better values in the accuracy indicators are marked in bold.  
\end{table} 
Table 3: Performance comparison between different models. large resulted in filtering out signal features other than noise (MD3-15). The presence of noise caused the model to learn these erroneous fluctuating features and fail to achieve accurate predictions when new data was input, i.e., poor generalization performance. However, the overuse of filters can lead to the loss of useful information, and the model trained in this case cannot effectively make predictions. Among the series models with the filtering process added, MD2 has the smallest RMSE of 115.52. It has the best setting for the frame length. The RMSE of the LSTM without data processing is 247.4. The RMSE and the power value have the same magnitude, so for the whole power variation range (0-3500), the error reduction is 3.8%.