## 3 Model Building and Algorithm Design
### Prediction Algorithm Design
The results are shown in Figure 9.

The results shown in Figure 9 show that within 6 weeks of using the mine pressure hazard prediction function in C Coal Mine, 20 pieces of data were selected at random time points in advance each week, and the prediction results of each datum were recorded. The prediction results were compared with the actual and statistically analyzed data to obtain

Figure 9: (**a**) Predicted results for week 1. (**b**) Predicted results for week 2. (**c**) Predicted results for week 3. (**d**) Predicted results for week 4. (**e**) Predicted results for week 5. (**f**) Predicted results for week 6. According to Table 6 and Formulas (19)-(22), the accuracy rate, precision rate, recall rate, and F1-score of the prediction function are 95%, 82.61%, 90.48%, and 0.86. The prediction results of the mine pressure hazard prediction function are similar to the actual comparison results. Among them, 19 of the 21 pieces of dangerous data were accurately predicted, with an accuracy of 90.4%. The prediction function effectively reduces the possibility of accidents caused by the occurrence of mine pressure danger. In the case test, it helped the mine manager of C Coal Mine locate the danger location and analyze the reason according to the predicted danger warning and make the right decision in time. The results of the comparison of the examples prove the feasibility of applying the logistic regression prediction model calculated using the Adagrad optimization algorithm for the actual mine pressure hazard prediction. ## 5 Discussion

Mine pressure changes during mining due to geological disturbance, often causing hidden danger. If workers are not made aware of these dangers in time, mine pressure accidents can very easily occur. To solve this problem, this paper combines logistic regression and mine pressure hazard prediction, calculates the evaluation index, and establishes a new mine pressure hazard prediction model based on logistic regression. The prediction model is simulated and compared using the Adagrad optimization algorithm and then applied to C Coal Mine for practical example verification. The main results are as follows:

1. The data obtained using the 3\(\sigma\) principle to remove outliers, delete missing values, and 0-mean normalized preprocessing have the best reliability among the data of the different studied preprocessing methods. The four evaluation indices of model prediction results were higher for the predicted model than those of the other pretreatment methods. 2. In this paper, the Adagrad optimization algorithm based on the batch gradient descent algorithm is used to solve the logistic regression model. The coefficients of eight evaluation indices in the regression model were obtained via iteration. The data were fed into a regression model with determined coefficients, and the predictions were calculated. Comparing the predicted results with the actual hazard results, the accuracy rate, precision rate, recall rate, and F1-score were 96%, 88.89%, 92.31%, and 0.91, respectively. Through the comparison of the results, the model proved to be effective in the simulation process and can be used for the actual prediction test in the actual production process. 3. By comparing the Adagrad optimization algorithm with SVM and decision tree classification algorithms, the accuracy rate, precision rate, recall rate, and F1-score of