## 2 Materials and Methods
### Limit-Data Generating Process
#### 2.2.1 Synthetic Minority Oversampling Technique-Nominal Continuous (SmoteNC)  
SmoteNC, which is based on the k-nearest neighbor algorithm, generates new samples of the minority class by using the k-nearest neighbors (Algorithm 1). It randomly generates eigenvectors using the minority features of the k-nearest neighbor. However, because the nearest neighbor of a categorical feature cannot be computed based on distance, this study replaced \"distance\" in the computation with \"frequency.\" Of the k-neighbors computed using numerical features, the minority categorical sample with the highest frequency was replicated as a new sample [20]. By increasing the quantity of minority data, the data was balanced. In addition, the numerical feature generation indicators are presented in Equation (1):  
\[S_{new}=S_{i}+rand(0,1)*\ (S_{i}-S_{j}) \tag{1}\]  
where \(S_{new}\) is the synthetic new data, \(S_{i}\) is the minority class data, \(S_{j}\) is one of the K nearest neighbors of \(S_{i}\), and \(T\) is the training data set. \(S_{i}\), \(S_{j}\)\(\subseteq\)\(T\), \(rand(0,1)\) is randomly generated random numbers from 0 to 1. ```
Input: Training data set \(T\) Which contains failure dataset (minority class) \(S\) Output: Synthesized failure dataset _Snew User defined parameter for k-nearest neighbors (Default k = 5)_

1. for i in len(S)
2. KNN(\(s_{i}\), k, \(T\)) // \(x\in X\)
3. do
4. if(numerical feature):
5. Generate new failure feature datausing Equation (1)
6. else:
7. Find the highest frequency data in the k nearest
8. j++
9. while(j < k)
10. Snew\(\leftarrow\)New fail data
11. Return Snew

Figure 2: Limit Data Generating Process. Studies have used SmoteNC on data sets with only nominal features [12; 21]. In [14], a random forest was used in advance to classify data with nominal features and eliminate data in the error category, thereby increasing data representativeness. These methods for handling imbalanced data were input into a ctGAN as training data to fulfill the demand of neural network training, namely, the requirement for considerable training data. Subsequently, the ctGAN was used to overcome the drawback of SmoteNC, namely, the lack of sample representativeness. #### 2.2.2 Conditional Tabular Generative Adversarial Network (ctGAN)

A ctGAN is a modified conditional GAN applicable to solving problems involving hybrid characteristics, which cannot be solved using a GAN (Algorithm 2). The operation of a ctGAN involves three stages. First, normalization is conducted to process complicated data combinations. Second, condition vectors and sample training methods are used to learn the original data distribution. Finally, a discriminator is used to determine the loss rate threshold and verify whether the simulated minority data generated in the second stage are close to the real minority sample. ctGAN loss function and network structure adopt the [22; 23] frameworks, respectively, and the generation network structure is G(m, cond) [19; 24]. \[\left\{ \begin{array}{l}c_{0}=cond\oplus m\\ c_{1}=c_{0}\oplus ReLU(BN(FC_{|cond|+|m|\to 256}(c_{0})))\\ c_{2}=c_{1}\oplus ReLU(BN(FC_{|cond|+|m|+256\to 256}(c_{1})))\\ \delta_{i}=tanh(FC_{|cond|+|m|+512\to 1}(c_{2}))\\ \beta_{i}=gumbel_{02}(FC_{|cond|+|m|+512\to n_{i}}(c_{2}))\\ \dot{d}_{i}=gumbel_{02}(FC_{|cond|+|z|+512\to|D_{i}|}(l_{2}))\end{array} \right. \tag{2}\]
```
Input: the training set of the fault data F, which includes The original training set S and the synthetic Snew by SmoteNC Output: Synthesized failure dataset Gnew by ctGAN //user setting Generate number 1. for i in len(F) 2. normalization and condition vector 3. R \(\leftarrow\)Generate new failure feature data using Equation (2) //input F 4. D\(\leftarrow\)Discriminator (R, S) //Calculate the loss rate of real fault 5. Data S and synthetic data. (loss function [9], network structure [10]) 6. Gnew\(\leftarrow\)D 7. return Gnew
```
**Algorithm 2**ctGAN(Pseudocode)

The proposed method has two advantages.