## 2 Method
### Data Preprocessing
The introduction of two random trees makes mitigates the chances of the random forest falling into over-fitting and provides it with good anti-noise ability. It can evaluate each variable's importance and perform feature selection on high-dimensional data, thereby making the model more robust. The calculation method of the importance of a certain feature \(X\) in a Random Forest is shown as follows:

1. For each decision tree in the Random Forest, we use the corresponding out-of-bag (OOB) data to calculate its error, denoted as \(err_{\mathit{oob}}1\);
2. Randomly add noise interference to the feature \(X\) of all samples of OOB data (the value of the sample at feature \(X\) can be randomly changed), and calculate its out-of-bag data error again and record it as \(err_{\mathit{oob}}2\);
3. Assuming that there are \(N\) trees in the random forest, then the importance of feature is expressed as \(X=\sum{(err_{\mathit{oob}}2-err_{\mathit{oob}}1)}/{N}\). After a certain feature is randomly added \begin{table}
\begin{tabular}{l l} \hline \hline
**Time-Domain Features** & **Expression** \\ \hline Root mean square (RMS) & \(RMS(x)=\sqrt{\frac{\sum_{i=1}^{n}x^{2}}{n}}\) \\ Peak-to-peak (pk-pk) & \(pk-pk(x)=\max(x)-\min(x)\) \\ Peak factor (pf) & \(pf(x)=\max(x)/RMS(x)\) \\ Waveform factor (wf) & \(wf(x)=RMS(x)\frac{\sum_{i=1}^{n}|x|}{\sum_{i=1}^{n}|x|}\) \\ Pulse factor (pf) & \(pf(x)=\max(x)\frac{\left(\frac{n}{\sum_{i=1}^{n}|x|}\right)}{\sum_{i=1}^{n}|x |}\) \\ Margin factor (mf) & \(mf(x)=\max(x)\left(\frac{n}{\sum_{i=1}^{n}x_{i}}\right)^{2}\) \\ Kurtosis (K) & \(K(x)=\frac{\frac{1}{n}\sum_{i=1}^{n}x^{2}}{\left(\frac{1}{n}\sum_{i=1}^{n}x^{2 }\right)^{2}}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Several time-domain features extracted. Figure 2: Wavelet packet decomposition. to the noise, the accuracy rate outside the bag is greatly reduced, which means that this feature greatly influences the classification result of the sample. ### Classification

#### 2.4.1 Use SVM to Deal with Two Classification Problems

SVM is a generalized linear classifier that classifies binary or multivariate data according to the supervised learning method, and its decision boundary is the maximum margin hyperplane for solving learning samples. The SVM separates different sample categories by constructing the optimal classification plane to maximize the boundary distance between two or more categories. The simplest SVM model is the maximum interval classifier. It is only suitable for the case where the sample data are linearly separable in the feature space. However, in practice, the training sample set is usually linearly inseparable, so parameter relaxation variables \(\xi\) are introduced. If the sample is misclassified during classification, \(\xi\) will be greater than 0. The following linear equation can describe any hyperplane:

\[\omega^{*}\cdot x+b^{*}=0 \tag{4}\]

The classification decision function is defined as

\[f(x)=sign(\omega^{*}\cdot x+b^{*})=sign\left[\sum\limits_{i=1}^{m}\alpha_{i}^ {*}y_{i}(x_{i}\cdot x)+b^{*}\right] \tag{5}\]

Let \(\sum\limits_{i=1}^{n}\xi_{i}\) describe the degree of misclassification of training samples. For the classification interface in the case of linear inseparability, it is hoped that the maximum classification interval \(2/\|\omega\|\) should be as large as possible, and the degree of misclassification of training samples \(\sum\limits_{i=1}^{n}\xi_{i}\) should be as small as possible. When errors occur, the degree of punishment for errors needs to be controlled, so the penalty factor \(C\) is introduced, which is an adjustable parameter. The larger \(C\) is, the heavier the penalty is. Consequently, the objective function can be written as:

\[ \begin{split}&\min\left[\frac{1}{2}\|\omega\|^{2}+C\left(\sum \limits_{i=1}^{n}\xi_{i}\right)\right]\\ & s.t.y_{i}(\omega^{T}x_{i}+b)\geq 1-\xi_{i},\xi_{i}\geq 0,i=1,2,...,n \end{split}  \tag{6}\]

Rewritten by Lagrangian duality transformation, we have:

\[