Tuberculosis (TB) continues to pose a significant threat to global public health. Enhancing patient prognosis is essential for alleviating the disease burden. This study aims to evaluate TB prognosis by incorporating treatment discontinuation into the assessment framework, expanding beyond mortality and drug resistance. Seven feature selection methods and twelve machine learning algorithms were utilized to analyze admission test data from TB patients, identifying predictive features and building prognostic models. SHapley Additive exPlanations (SHAP) were applied to evaluate feature importance in top-performing models. Analysis of 1,086 TB cases showed that a K-Nearest Neighbor classifier with Mutual Information feature selection achieved an area under the receiver operation curve (AUC) of 0.87 (95% CI: 0.83–0.92). Key predictors of treatment failure included elevated levels of 5'-nucleotidase, uric acid, globulin, creatinine, cystatin C, and aspartate transaminase. SHAP analysis highlighted 5'-nucleotidase, uric acid, and globulin as having the most significant influence on predicting treatment discontinuation. Our model provides valuable insights into TB outcomes based on initial patient tests, potentially guiding prevention and control strategies. Elevated biomarker levels before therapy are associated with increased risk of treatment discontinuation, indicating their potential as early warning indicators.