Accurately predicting and estimating the squeezing and ground response to tunneling remains challenging. Moreover, tunnel-squeezing hazards are much more likely to occur in deeply buried long tunnels with complex engineering-geological environments. Therefore, a high-performance predictive model for tunnel squeezing is necessary. A superior ensemble classifier is put forward in this study, which is composed of four individual classifiers (gradient boosting classifier, extra-trees classifier, AdaBoost classifier, and Logistic regression classifier) and two optimization algorithms (Bayesian optimization (BO) and sparrow search algorithm (SSA)). The training database covers five parameters: tunnel depth (H), rock tunneling quality index (Q), tunnel diameter (D), support stiffness (K), and strength stress ratio (SSR), about which the basic information is accessible at the early design phases. However, the dataset compiled from the literature is insufficient. Thus, the ten proposed methods are used to replace the missing values. During the model training process, BO shows its strong ability to optimize seventeen hyperparameters. When applied to tune the classifiers' weights, SSA achieves a fast and efficient performance. The novel Shapley Additive Explanations–LightGBM method indicates that the K is the most important input feature, followed by SSR, Q, H, and D, respectively. The ensemble classifier is then validated using the test set and additional historical case projects. The validation shows that the model can achieve an accuracy of 98% (i.e., the error rate is 2%) on the test set, higher than those achieved by previous prediction models. Moreover, the predicted probability could provide warning information for timely support measures. Finally, the application results are illustrated through tests on the tunnel sections that have not yet been excavated in the line of the Sichuan–Tibet railway project. The applied predictive tendencies and laws are in line with the practical experience. In summary, the proposed model's prediction results are reasonable, and its prediction will be more accurate as more data is collected and trained for prewarning the tunnel squeezing hazard.