Histopathological evaluation is currently the gold standard for grading gliomas; however, this technique is invasive. This study aimed to develop and validate a diagnostic prediction model for glioma by employing multiple machine learning algorithms to identify risk factors associated with high-grade glioma, facilitating the prediction of glioma grading. Data from 1114 eligible glioma patients were obtained from The Cancer Genome Atlas (TCGA) database, which was divided into a training set (n= 781) and a test set (n= 333). Fifty machine learning algorithms were employed, and the optimal algorithm was selected to construct a prediction model. The performance of the machine learning prediction model was compared to the clinical prediction model in terms of discrimination, calibration, and clinical validity to assess the performance of the prediction model. The area under the curve (AUC) values of the machine learning prediction models (training set: 0.870 vs. 0.740, test set: 0.863 vs. 0.718) were significantly improved from the clinical prediction models. Furthermore, significant improvement in discrimination was observed for the Integrated Discrimination Improvement (IDI) (training set: 0.230, test set: 0.270) and Net Reclassification Index (NRI) (training set: 0.170, test set: 0.170) from the clinical prognostic model. Both models showed a high goodness of fit and an increased net benefit. A strong prediction accuracy model can be developed using machine learning algorithms to screen for high-grade glioma risk predictors, which can serve as a non-invasive prediction tool for preoperative diagnostic grading of glioma.