Background: Gliomas are the most common primary malignant tumors of the central nervous system. Accurate preoperative grading is essential for individualized surgical planning and treatment selection; however, reliable non-invasive prediction tools integrating multimodal preoperative data remain limited. This study aimed to develop and internally validate an interpretable machine-learning model for non-invasive glioma grading. Methods: Clinical and imaging data from 400 patients with pathologically confirmed gliomas were retrospectively collected. Twenty-four preoperative variables were analyzed. The dataset was randomly divided into training and validation cohorts (7:3). Feature selection was performed using a combination of the Boruta algorithm and logistic regression analyses, followed by correlation filtering. Seventeen machine-learning algorithms were benchmarked using five-fold cross-validation, and the optimal model was evaluated in the independent validation cohort using ROC analysis, calibration assessment, precision–recall curves, and decision curve analysis. Model interpretability was examined using SHAP. Results: Eight key predictors were identified, including age, focal neurological deficits, midline shift, tumor laterality, tumor lobar location, enhancing tumor volume, and MRS-derived Cho/NAA and Cho/Cr ratios. The Random Forest model achieved an area under the ROC curve of 0.946 (95% CI: 0.902–0.989) in the validation cohort. Calibration analysis demonstrated reasonable agreement between predicted and observed outcomes, and the precision–recall curve yielded an average precision of 0.98. Decision curve analysis indicated net clinical benefit across relevant probability thresholds. Conclusions: A multimodal machine-learning model integrating clinical, structural imaging, and MRS-derived metabolic features was developed and internally validated for non-invasive preoperative glioma grading. The model showed good discrimination and calibration and provided individualized probability estimates, suggesting potential value for preoperative risk stratification. However, clinical deployment remains premature, and further external validation is required.
Background: Postoperative pneumonia (POP) is a frequent complication after microsurgical clipping for aneurysmal subarachnoid hemorrhage (aSAH). Early preoperative identification of high-risk patients may facilitate timely preventive management. This study aimed to develop and internally validate an explainable machine learning model based on routinely available admission variables and translate it into a web-based risk calculator. Methods: This single-center retrospective study included 574 patients with aSAH who underwent microsurgical clipping between 2019 and 2024. Patients were randomly divided into training and internal validation cohorts at a ratio of 7:3. Feature selection was performed using Spearman correlation analysis and the Boruta algorithm. Thirteen machine learning algorithms were compared using five-fold cross-validation, and the optimal model was evaluated in the internal validation cohort. SHAP analysis was used to interpret model predictions. Results: Thirteen predictors were retained for model development. The random forest model implemented using ranger showed the best overall performance, achieving an AUC of 0.887 (95% CI, 0.838–0.936) in the internal validation set. Calibration was acceptable, with a Brier score of 0.135, and decision curve analysis suggested potential clinical net benefit. SHAP analysis identified D-dimer and Glasgow Coma Scale score as the leading contributors to model predictions. An interactive R Shiny calculator was developed for individualized POP risk estimation. Conclusions: An explainable ranger-based random forest model using readily available admission and preoperative variables showed good discrimination and acceptable calibration for predicting POP after aSAH clipping. The model may enable risk estimation before surgery without specialized testing and support early individualized risk stratification. External and prospective validation is required before broader clinical implementation.