# An Evaluation of Mine Water Inrush Based on Data Expansion and Machine Learning
## 2 Materials and Methods
### Natural Neighbor-Based Spatial Interpolation SMOTE
This step is repeated until borderline sample oversampling is complete. Figure 3 shows the borderline sample oversampling method. Figure 3: Borderline sample oversampling method. Figure 2: Noise points and outliers in the dataset. For the center minority sample \(x_{i}\in Safe\) in the dataset, sample \(S_{1}\) is selected, and the sample point \(S_{new}\) with the largest Euclidean distance \(d\) between the selected sample and the _Safe_ dataset is calculated to form a sampling space, as shown in Figure 4. Assume that \(S_{1}\) = (\(x_{1}y_{1}\)) and the farthest Euclidean distance sample point in the minority class sample set is \(S_{d}\) = (\(x_{2}\),\(y_{2}\)). A data point is randomly sampled in the adoption space as a synthetic sample point \(S_{new}\) = (\(x_{new}\),\(y_{new}\)), where \(x_{new}\) = \(random(x_{2}\),\(x_{1}\)) and \(y_{new}\) = \(random(y_{2}\),\(y_{1}\)). Different from the SMOTE, the new synthetic sample point is located in the sampling space formed by the selected sample and its farthest sample in the minority class rather than on the line connecting the two points. The ISMOTE algorithm's training steps are as follows:  
1. Assuming that the minority class samples in the sample dataset are {\(S_{1}\), \(S_{2}\), \(\ldots\), \(S_{n}\)}, define K as the chosen hyperparameter (often the difference between the number of majority class data and the number of minority class data);
2. Determine how many natural neighbors each sample has using the natural neighbor search technique, eliminate noise and outliers, separate a few samples into boundary and safe regions, and establish the edge sample set \(S_{i}\in Danger\) and the safe sample set \(S_{i}\in Safe\);
3. The spatial interpolation sampling technique suggested in this paper is applied to oversample \(S_{i}\) if \(S_{i}\in Safe\). If \(S_{i}\in Danger\), \(S_{i}\) is sampled using the natural nearest intermediate point random interpolation suggested in this research, and a new sample \(S_{new}\) is created. 4. Determine the average distance a and b between the majority and minority samples and the composite sample;
5. Add the synthetic sample to the dataset if \(a<b\), and remove it if \(a>b\). 6. If the number of iterations approaches \(K\), the program terminates; if not, proceed to step (2). The farthest-distance sample point is selected to form a sampling space to randomly form synthetic samples. Compared with linear sampling, the proposed sampling approach can form a more diverse synthetic sample set, and there will be no situation where sample-dense areas become denser and sparse areas become sparser and effectively addresses the drawbacks of the SMOTE algorithm, which alters the data distribution pattern with ease. The spatial interpolation method enhances the sample set's mathematical features' comprehensiveness and diversifies the characteristics of the minority class data. The results of _NaN-ISMOTE_ algorithm under complex data distribution conditions is shown in Figure 5.  
Figure 4: Center sample space oversampling method. The G-mean was employed as the evaluation metric to assess overall classification performance, particularly suitable for imbalanced small-sample datasets. The G-mean is mathematically defined as follows:  
\[\text{G-mean}=\sqrt{\frac{TP}{P}\times\frac{TN}{Q}} \tag{5}\]  
In the formula, the G-mean index can evaluate the overall effect of the algorithm on unbalanced small sample data. When good classification results are obtained on both positive and negative class datasets, a larger G-mean value can be obtained. Ten standard small sample datasets similar to the collected water inburst sample sets of coal mine floor were selected, all of which were binary classification data with feature quantities ranging from 5 to 30 and imbalance ratios ranging from 1.25 to 129.44. All samples were standardized before sampling to reduce the impact of different dimensions on the algorithm. We used ISMOTE and SMOTE with a value of K = 5.