# Coal Mine Water Inflow Prediction Model Based on Multi-Factor Pearson Correlation Analysis
## 4 Case Study  
Firstly, the model parameters are introduced. The process batch is set to 12, the number of iterations is 300, the learning rate is set to 0.001, the optimizer is Adam, the input sequence length is 12, and the output sequence length is 6. To validate the accuracy of predicting coal mine water inflow, Figure 7 shows the predicted coal mine water inflow and collected coal mine water inflow, where the ratio of the training set to the test set is 8:2. The green line is coal mine water inflow data collected by the smart coal mine data collection system, and the blue line is the coal mine water inflow data predicted with the present prediction model. The magnitude and development trend of predicted coal mine water inflow in the next 8 h is close to the collected coal mine water inflow; that is to say, the present prediction model can predict the magnitude and development trends of coal mine water inflow in the next 8 h accurately. Furthermore, the uncertainty of the predicted coal mine water inflow is investigated. The calculation of the uncertainty is as follows. Firstly, calculate the mean value \(\overline{x}\) and standard deviation \(s\) of data points. Then, calculate the standard error \(SE=s/\sqrt{n}\), where \(n\) is the number of data points. Finally, calculate the upper and lower limits of the confidence interval with \(\overline{x}\pm 1.96\times SE\). As shown in Figure 8, the predicted water inflow is close to the collected water inflow. Among 157 data points, most of the data points are within the 95% confidence interval of the predicted water inflow, i.e., the present prediction model can predict the magnitude and development trends of coal mine water inflow in the next 8 h accurately. After the magnitude and development trends of coal mine water inflow in the next 8 h are predicted, to improve coal mining safety management, early warning of coal mine water inflow is made according to detailed rules of coal mine water inflow prevention and control, which are listed in Table 1. If the risk levels of coal mine water inflow are low or relatively low, coal mining is not affected by water inflow, and water inflow prevention and control are simple. If the risk level of coal mine water inflow is medium, coal mining is affected by water inflow, but it does not threaten coal mining safety. If the risk of coal mine water inflow is relatively high, water inflow is threatening coal mining safety, coal mining is not permitted, people must be evacuated to a safe area, and drainage systems are partly open. If the risk of coal mine water inflow is high, water inflow is seriously threatening coal mining safety, coal mining is not permitted, people must be evacuated to a safe area, and drainage systems are completely open. Figure 7: Predicted coal mine water inflow and collected coal mine water inflow. To validate the performance of the present prediction model, the evaluation indicators are defined, including mean absolute error (MAE), mean absolute percentage error (MAPE), root mean squared error (RMSE), and correlation coefficient R\({}^{2}\):  
\[\text{MAE}=\frac{1}{n}\sum_{i=1}^{n}\left|y_{i}^{*}-y_{i}\right| \tag{4}\]  
\[\text{MAPE}=\frac{100\%}{n}\sum_{i=1}^{n}\left|\frac{y_{i}^{*}-y_{i}}{y_{i}}\right| \tag{5}\]  
\[\text{RMSE}=\sqrt{\frac{\sum_{i=1}^{n}(y_{i}^{*}-y_{i})^{2}}{n}} \tag{6}\]  
\[\text{R}^{2}=1-\frac{\sum_{i=1}^{n}(y_{i}^{*}-y_{i})^{2}}{\sum_{i=1}^{n}(y_{i} ^{*}-y_{i})^{2}} \tag{7}\]  
where \(y_{i}\) is the actual value, \(y_{i}^{*}\) is the predicted value, \(\overline{y_{i}^{*}}\) is the mean of the predicted values, and \(n\) is the number of the predicted values. Among them, MAE and RMSE are absolute error representations of water inflow, and MAPE is the relative error representation of water inflow. The smaller the above three indicators, the smaller the error between the predicted value and the actual value.