# An Evaluation of Mine Water Inrush Based on Data Expansion and Machine Learning
## 2 Materials and Methods
### Natural Neighbor-Based Spatial Interpolation SMOTE  
This paper introduces the natural neighbor theory into the SMOTE algorithm. First, the natural neighbor search algorithm in Algorithm 1 is used to search the dataset to remove noise and outliers. Then, the minority class samples are divided into center samples and borderline samples based on the natural neighbor theory, and two different spatial interpolation methods are used to generate new water inrush samples. Finally, we add the synthesized water inrush samples to the dataset to expand the water inrush dataset [24; 25]. Figure 1 shows the main structure of the algorithm proposed in this article. The model performs three steps in the oversampling stage, including removing outliers and noise points, distinguishing borderline samples and center samples, and synthesizing new instances. A binary classification dataset \(X\) consists of majority class samples \(S_{maj}\) and minority class samples \(S_{min}\). \(\textit{Label}(x_{i})\) represents the class label of sample \(x_{i}\in X\). Based on the natural neighbor theory, noise samples and outlier samples are defined as follows:  
Definition 1: If sample \(x_{i}\) satisfies \(\forall x_{j}\in\textit{NaN}(x_{j})\) and \(\textit{Label}(x_{j})\
eq\textit{Label}(x_{j})\), then \(x_{i}\) is a noise point. That is, if \(x_{i}\) belongs to the minority class sample but its natural neighbors are all majority class samples, then \(x_{i}\) is defined as a noise point. Definition 2: If sample \(x_{i}\) satisfies \(|\textit{NaN}(x_{i})|=0\), \(|\textit{NaN}(x_{i})|\) represents the number of natural neighbors of \(x_{i}\). Then, \(x_{i}\) is defined as an outlier. Noise and outliers in the dataset will affect the normal data distribution of the sample, making it difficult for the classifier to fit the offset points and thus resulting in a decrease in the generalizability of the prediction model. Therefore, in the coal mine water inrush prediction model, noise and outliers must first be removed from the dataset. After removing noise and outliers from the preprocessed water inrush dataset, it becomes a regularly distributed dataset, and better prediction accuracy can be achieved. Definition 3: If sample \(x_{i}\in S_{min}\) and \(x_{i}\) is not noise or an outlier, if \(\exists x_{j}\in\textit{NaN}(x_{j})\) makes \(\textit{Label}(x_{j})\
eq\textit{Label}(x_{i})\), then \(x_{i}\) is defined as a borderline minority class sample. Figure 1: The overview of the proposed model. There are majority class samples in the natural neighbor sample of the borderline samples, but when their natural neighbors are all majority class samples, \(x_{i}\) is a noise point. Figure 2 shows the noise points and outliers in the dataset. According to the natural neighbor search algorithm, borderline minority class samples existing in the dataset can be identified through traversal, and the Danger dataset is used to store these borderline samples. Since there are majority class samples among the natural neighbors of the borderline samples, it is easier to synthesize incorrect class samples during oversampling. Therefore, in this paper, two different spatial oversampling methods are used to oversample center minority samples and borderline minority class samples, thereby generating new samples of the required categories and reducing noise and damage to the distribution of the dataset [26]. For the borderline sample \(S_{i}\in\)_Danger_, two minority class natural neighbor samples, \(S_{i1}\) and \(S_{i2}\), of \(x_{i}\) are randomly selected. The algorithm first uses the natural neighbor sample \(S_{i1}\) and \(S_{i2}\) to synthesize the midpoint according to Formulas (3) and (4) and then connects \(x_{i}\) and the _midpoint_ and performs interpolation to synthesize a new sample. \[S_{\text{mid}}=S_{i1}+\delta_{1}(S_{i2}-S_{i1}) \tag{3}\]  
\[S_{i}^{new}=S_{i}+\delta_{2}(S_{mid}-S_{i}) \tag{4}\]  
\(\delta_{1}\) and \(\delta_{2}\) in the formula are two random numbers between 0 and 1.