In order to further improve the predictive effect of rock blasting fragmentation,the blasting statistical data of several mines was used to build a prediction model,which was based on feature selection by random forest and the XGBoost regression prediction model optimized by the sparrow search algorithm.Aiming at improving the operating efficiency of the XGBoost regression prediction model,the sparrow search algorithm(SSA)was used to optimize their three core hyperparameters,including the number trees,the max depth and the learning rate.The input features selected by random forest were input into the model.The prediction effect of blasting fragmentation is closer to the actual value,and the R-squared(R2),the root mean square error(RMSE)and the mean absolute error(MAE)of the prediction results are 0.954,0.026 and 0.020.Compared with the back propagation(BP)neural network,the random forest and the XGBoost model,the proposed model is better and more applicable.It is concluded that the proposed model is more adaptive in practical application,and can provide reference for the design and optimization of blasting parameters.