# Fault Diagnosis for Wind Turbines Based on ReliefF and eXtreme Gradient Boosting
## 4 Case Analysis and Result Comparison
### Fault Identification with XGBoost  
In order to get the operation status of the wind turbine by using the SCADA system monitoring parameters, it is necessary to realize the mapping from the feature space to the state space of the wind turbine. After extracting the fault related parameters, we had to modify the original experimental data set and delete the monitoring values of unrelated items. The data set consisted of 28 columns, including 27 observation parameter columns and one status coding column. Then we needed to use the XGBoost classifier to complete the mapping from the observation parameter value to the state of the wind turbine. Finally, we were able to achieve the goal of obtaining the fault type through the value of 27 observation parameters.  
We divided 70% of the experimental data into a training set, 20% into a validation set, and 10% in the test set. Then we input the training data set into the XGBoost model for fault recognition training. By constantly adjusting the parameters, we finally obtained the optimal classification model. The optimal parameters are shown in Table 5.  
In Table 5, \"n estimators\" is the maximum number of trees generated and the maximum number of iterations. \"learning rate\" refers to the step size of each iteration, and the system default value is 0.3. If the value of \"learning rate\" is too large, the running accuracy will be low, and if it is too small, the running speed will be slow. \"max depth\" is the maximum depth of the tree. The default value is 6, which is used to control over fitting. The larger the value of \"max depth\", the more specific the model learning. \"min child weight\" refers to the minimum sample weight required to generate a child node. If the sample weight on the newly generated child node is less than the number you specify, then the child node will not grow. \"objective\" is used to define learning tasks and corresponding learning objectives. The objective function selected in this paper is \"multi: softmax\". The purpose of using this parameter is to let XGBoost use softmax objective function to deal with multi classification problems. \"num class\" refers to the number of categories in multi classification, and \"nthread\" refers to the number of threads opened when the program is running.  
After training and parameter adjustment, we finally got a XGBoost model with better classification effect. Confusion matrix, also known as error matrix, is a standard format for precision evaluation. After inputting the test data set into the XGBoost model, we finally got the confusion matrix of the test set as shown in Figure 4.  
The abscissa in Figure 4 represents the prediction category of the sample, and the ordinate represents the actual category of the sample. It can be seen from the confusion matrix that there are 700 samples in the test sample set. According to Figure 4, the predicted and actual categories of all samples are exactly the same. Through the analysis, the classification accuracy of the test set data in the XGBoost model was as high as 100%.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline n estimators & 200 \\ learning rate & 0.12 \\ max depth & 5 \\ min child weight & 1 \\ objective & Multi:softmax \\ num class & 7 \\ nthread & 4 \\ \hline \hline \end{tabular}
\end{table}
Table 5: Parameters for extreme gradient boosting.