OBJECTIVE: This study was designed to establish a diagnostic model for osteoporosis by collecting clinical information from patients with and without osteoporosis. Various machine learning algorithms were employed for training and testing the model, evaluating its performance, and conducting validations to explore the most suitable machine learning algorithm. METHODS: Clinical information, including demographic data, examination results, medical history, and laboratory test results, was collected from inpatients with and without osteoporosis. The LASSO algorithm was utilized for feature selection, and multiple machine learning algorithms were applied to calculate the model's accuracy, precision, recall, F1 score, and average precision (AP) value. Receiver operating characteristic (ROC) curves for each algorithm were plotted, and a comprehensive evaluation was conducted to identify the most suitable machine learning model. Finally, the model's predictive accuracy was validated using corresponding information from other patients. RESULTS: A total of 1063 patients were included
562 had osteoporosis, and 501 did not. After LASSO feature selection, the most important features for the model's predictive results were determined to be age, height, weight, alkaline phosphatase activity, and osteocalcin. Evaluation of the accuracy, precision, recall, F1 score, and AP value for each algorithm, along with ROC curves, led to the selection of the light gradient boosting machine (LGBM) algorithm as the best algorithm for the model. The validation results confirmed the model's excellent predictive ability. CONCLUSION: This study established a preliminary diagnostic model for osteoporosis, contributing to increased efficiency in diagnosing the disease.