# A Novel Intelligent Method for Fault Diagnosis of Steam Turbines Based on T-SNE and XGBoost
## 2 Methods  
### Performance Indicator Extraction Based on t-SNE and K-Means  
The t-SNE algorithm is a nonlinear dimensionality reduction algorithm that maps multi-dimensional data into two or more dimensions by the similarity of high-dimensional data [21,22]. It has been applied to many fields, including image processing [23], genetics [24], and materials science [25]. In this paper, the input of t-SNE is signal features extracted by data acquisition equipment. According to the similarity of signal features, these features are further reduced. The main algorithm is as follows and the source code of the t-SNE algorithm is in Appendix A.  
(1) The conditional probability of distribution \(p_{j|i}\) between the corresponding data \(x_{i}\) and \(x_{j}\) in the high-dimensional space is calculated to represent the similarity between the data. The high-dimensional data, \(x_{i}\) and \(x_{j}\), correspond to the mapping points \(y_{i}\) and \(y_{j}\) in a low dimension and \(q_{j|i}\) is their similar conditional probability distribution. The initial value is \(Y^{(0)}=\big{\{}y_{1}\quad y_{2}\quad\cdots\quad y_{n}\big{\}}\). \(p_{j|i}\) and \(q_{j|i}\) are calculated as follows.  
\[p_{j|i}=\frac{\exp(-\big{\|}x_{i}-x_{j}\big{\|}^{2}/2\sigma_{i}^{2})}{\sum_{k \
eq i}\exp(-\big{\|}x_{i}-x_{k}\big{\|}^{2}/2\sigma_{i}^{2})} \tag{1}\]  
\[q_{j|i}=\frac{\exp(-\big{\|}y_{i}-y_{j}\big{\|}^{2})}{\sum_{k\
eq i}\exp(- \big{\|}y_{i}-y_{k}\big{\|}^{2})} \tag{2}\]  
where \(\sigma_{i}\) is the Gaussian distribution variance centered on \(x_{i}\).  
(2) Calculating the joint probability density \(p_{ij}\) of high dimensional samples.  
\[p_{ij}=\frac{p_{j|i}+p_{i|j}}{2n} \tag{3}\]  
(3) Calculating the joint probability density \(q_{ij}\) of the low dimensional samples.  
\[q_{ij}=\frac{\Big{(}1+\big{\|}y_{i}-y_{j}\big{\|}^{2}\Big{)}^{-1}}{\sum_{k \
eq l}\Big{(}1+\big{\|}y_{k}-y_{l}\big{\|}^{2}\Big{)}^{-1}} \tag{4}\]  
(4) Calculating the loss function C and its gradient. C is defined by the Kullback-Leibler (KL) distance to evaluate the similarity degree of joint probability density \(p_{ij}\) and \(q_{ij}\).  
\[\text{C}=\text{KL}=\sum_{i}\sum_{j}p_{ij}\log\frac{p_{ij}}{q_{ij}} \tag{5}\]  
\[\frac{\delta\text{C}}{\delta y_{i}}=4\sum_{j}\big{(}p_{ij}-q_{ij}\big{)}\big{(} y_{i}-y_{j}\big{)}\Big{(}1+\big{\|}y_{i}-y_{j}\big{\|}^{2}\Big{)}^{-1} \tag{6}\]  
(5) Iterative updating.  
\[Y^{(t)}=Y^{(t-1)}+\eta\frac{\delta\text{C}}{\delta y}+\alpha(t)\Big{(}Y^{(t-1 )}-Y^{(t-2)}\Big{)} \tag{7}\]  
where \(t\) is the number of iterations, \(\eta\) is the learning rate, and \(\alpha(\cdot)\) is the momentum factor.  
(6) Returning to (4) and (5) until the number of iterations is reached.  
After obtaining the low-dimensional data output by the t-SNE algorithm, the K-means clustering algorithm [26] was used to classify the data into two categories. This algorithm is used to classify fault dangerous intervals. When a single fault hazardous interval is identified, the data is divided into fault data and normal data. However, the lack of failure records leads to an imbalance problem.