## 2 Effects of the Imbalanced Data Problem on TSSP
### The Effect on the Decision Boundary  
The TSSP based on machine learning methods can be regarded as a binary classification problem and the decision boundary between stable and unstable classes is built by the classification method in the feature space. Given the training set \(D\)= {(\(\mathbf{x}_{1},y_{1}\)), (\(\mathbf{x}_{2},y_{2}\)),..., (\(\mathbf{x}_{N},y_{N}\))], \(y_{i}\in\) [-1,1], the loss function of the machine learning method is generally expressed as follows:  
\[\varepsilon(f;D)=\frac{1}{N}\sum\limits_{i=1}^{N}I(f(\mathbf{x}_{i})\
eq y_{i }), \tag{1}\]  
where \(\mathbf{x}_{i}\) represents the feature vector of sample \(i\) and \(y_{i}\) is the corresponding class label. Here, if \(y_{i}\) = 1, it is unstable; otherwise, it is stable. The value \(N\) is the number of training samples. The value \(f\) represents the decision function. The \(I\) is indication function and if its internal logic is true, the value is 1; otherwise, it returns 0.  
For transient stability status classification problem, training set \(D\) can be divided into the stable set \(D_{S}\) and the unstable set \(D_{U}\), and Equation (1) can be further expressed as follows:  
\[\begin{array}{rl}\varepsilon(f;D)&=\frac{1}{N}\sum\limits_{\mathbf{x}_{i} \in D_{S}}I(f(\mathbf{x}_{i})\
eq y_{i})+\frac{1}{N}\sum\limits_{\mathbf{x}_{i }\in D_{U}}I(f(\mathbf{x}_{i})\
eq y_{i})\\ &=\frac{N_{S}}{N}\sum\limits_{\mathbf{x}\in D_{S}}\frac{I(f(\mathbf{x}_{i}) \
eq y_{i})}{N_{S}}+\frac{N_{U}}{N}\frac{\sum\limits_{\mathbf{x}_{i}\in D_{U}} I(f(\mathbf{x}_{i})\
eq y_{i})}{N_{U}}\end{array} \tag{2}\]  
where \(\varepsilon_{S}\) and \(\varepsilon_{U}\) are the classification error rates of stable class and unstable class, respectively, and \(N_{S}\) and \(N_{U}\) are the number of stable samples and unstable samples in the training set, respectively.  
From Equation (2), it can be seen that the loss function of the classification algorithm is not only related to the classification error rate of stable class and unstable class, but also closely related to the sample number of each class. For the stability status classification problem, the stable samples are always more than the unstable ones, which indicates that, compared to the unstable class, the proportion of the classification error rate of the stable class is relatively larger. Therefore, due to the imbalanced data problem, the decision boundary of the classification method will shift towards the unstable class to reduce the classification error rate of stable class, resulting in the poor classification performance of the unstable class.  
The imbalanced ratio (IR) of training set is defined as follows:  
\[IR=\frac{N_{S}}{N_{U}}. \tag{3}\]  
Figure 1: Illustration of transient stable and unstable cases.  
In order to illustrate the effect of IR on the decision boundary of the classification model, the IEEE 39-bus system is taken as the test system. Employing the approach proposed in our previous study [19], the database is generated and the importance of features is ranked. For visualization of the decision boundary, the top 2 features, \(f_{1}\) and \(f_{2}\), are utilized to build the classification model. Here, \(f_{1}\) represents the variance of generator rotor angles at the fault clearing time and \(f_{2}\) is the mean absolute of the generator angular velocities at the fault clearing time.  
To construct different training sets based on different IRs, the number of unstable samples is fixed to 100 and the number of stable samples is respectively chosen as 100 (IR = 1), 200 (IR = 2), 400 (IR = 4), 600 (IR = 6), 800 (IR = 8), and 1000 (IR = 10). The logistic regression method is employed as the classifier. The decision boundaries of the classifier under different IRs are all depicted in Figure 2.  
It can be seen from Figure 2 that as the IR increases, the decision boundary of classification model gradually shifts towards the unstable class that has fewer samples.