A multi-stage machine learning framework for stepwise prediction of tuberculosis treatment outcomes: Integrating gradient boosted decision trees and feature-level analysis for clinical decision support

preprint OA: gold CC-BY-4.0
Full text 148,729 characters · extracted from preprint-html · click to expand
A multi-stage machine learning framework for stepwise prediction of tuberculosis treatment outcomes: Integrating gradient boosted decision trees and feature-level analysis for clinical decision support | Research Square window.SnipcartSettings = { analytics: { enabled: false } }; (function() { var accessVector = localStorage.getItem('access_vector') || ''; window.dataLayer = window.dataLayer || []; if (accessVector) { window.dataLayer.push({ user: { profile: { profileInfo: { snid: accessVector } } } }); } })(); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K279D39R'); Browse Preprints In Review Journals COVID-19 Preprints AJE Video Bytes Research Tools Research Promotion AJE Professional Editing AJE Rubriq About Preprint Platform In Review Editorial Policies Our Team Advisory Board Help Center Sign In Submit a Preprint Cite Share Download PDF Research Article A multi-stage machine learning framework for stepwise prediction of tuberculosis treatment outcomes: Integrating gradient boosted decision trees and feature-level analysis for clinical decision support Linfeng Wang, Susana Campino, Taane G. Clark, Jody E. Phelan This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-7558046/v1 This work is licensed under a CC BY 4.0 License Status: Posted Version 1 posted You are reading this latest preprint version Abstract Tuberculosis (TB) remains a global health crisis, with multidrug-resistant (MDR-TB) and extensively drug-resistant (XDR-TB) strains posing significant challenges to treatment. With the increasing availability of clinical and diagnostic data, artificial intelligence methods offer significant potential to transform treatment strategies and improve patient outcomes. In this study, we leveraged the comprehensive TB Portal database, which includes clinical, radiological, demographic, and genomic data from 15,997 patients across high-burden countries, to develop a machine learning model based on gradient-boosted decision trees for predicting tuberculosis treatment outcomes (e.g., success or failure). Using the open-source XGBoost library, our model categorises features into four temporally defined diagnostic stages, pre-treatment, microbiological, post-imaging, and treatment, aligning with the typical clinical workflow to support real-time decision-making. This stepwise framework enables the model to progressively incorporate available data while maintaining robust predictive performance, even in the presence of missing values typical of real-world healthcare settings. The model achieved high predictive accuracy (AUC-ROC: 0.96, F1-score: 0.94), with key predictors including age of onset, drug resistance, and treatment adherence. Regional analysis highlighted variability in performance, underscoring the potential for localised model adaptation. By accommodating missing data at various diagnostic stages, our model provides actionable insights for personalised TB treatment strategies and supports clinical decision-making in diverse and resource-constrained contexts. Figures Figure 1 Figure 2 Introduction Tuberculosis (TB), caused by Mycobacterium tuberculosis ( Mtb ), remains a significant global health challenge. In 2023, approximately 10.8 million individuals contracted TB, and 1.3 million succumbed to the disease 1 . The emergence of drug-resistant Mtb strains has exacerbated this crisis. Globally, about 3.4% of new TB cases and 18% of previously treated cases exhibit resistance to rifampicin (RR-TB), with many also resistant to isoniazid, classifying them as multidrug-resistant TB (MDR-TB) 1 , 2 . Alarmingly, 6.2% of MDR-TB/RR-TB cases progress to extensively drug-resistant TB (XDR-TB), characterised by additional resistance to fluoroquinolones and at least one Group A drug, such as bedaquiline or linezolid 1 . Several interrelated factors significantly influence TB treatment outcomes, including patient-related conditions such as HIV infection, comorbidities like diabetes, alcoholism, and cancer, as well as nutritional status. Treatment-related variables such as adherence to drug regimens and the presence of drug resistance further complicate the clinical picture. Socio-economic factors, including unemployment and limited access to healthcare, also contribute to poorer outcomes. Populations affected by conditions like HIV, diabetes, and smoking are particularly vulnerable 3 – 5 , as these complications are known to worsen treatment response. This complexity and variability in patient outcomes highlight the urgent need for predictive tools. Machine learning models can integrate diverse patient data and anticipate treatment trajectories, offering a pathway toward more personalised and effective TB care. Such methods have been employed successfully in other fields, such as cancer treatment and survival prediction 6 , 7 . Traditional diagnostic and therapeutic approaches in TB often fall short in addressing the complexities of drug-resistant Mtb and the diverse responses among patients. This highlights the necessity for innovative solutions that can provide rapid, accurate, and cost-effective insights into treatment dynamics. The TB Portal database 8 is a global open-access platform designed to facilitate the sharing and analysis of comprehensive data on drug-resistant TB. Developed through an international collaboration of clinicians, radiologists, microbiologists, and data scientists, it currently includes data from 15,997 patient cases across high-burden countries, such as Azerbaijan, Belarus, Georgia, Moldova, and Romania. The dataset captures diverse clinical, radiological, demographic, and socioeconomic features, providing a detailed foundation for studying TB. It includes metrics on lung pathology, such as cavity sizes, nodule types, and infiltrate densities, alongside patient comorbidities like diabetes, HIV, and anaemia. Treatment-related details, including regimen composition, adverse events, and resistance profiles, are extensively documented. Additionally, demographic attributes such as age of onset, gender, education level, and social risk factors (e.g., homelessness, migrant status, or documented MDR contact) are recorded, along with diagnostic data from GeneXpert and drug sensitivity tests and genomic classifications of Mtb lineages 8 . A significant portion of the cases in the TB Portal database involve MDR-TB (43%) or XDR-TB (9%). The database incorporates imaging data for many cases, including X-rays (11%) and computed tomography (CT) scans (85%). Genomic insights further enrich the dataset, detailing Mtb mutations that confer resistance to critical drugs, such as isoniazid and rifampicin. This public, curated, and standardised dataset makes it a powerful resource for applying machine learning (ML) methods to predict treatment outcomes and uncover the factors driving TB progression and response to therapy 8 . Amongst these ML approaches, decision trees implemented through the XGBoost (Extreme Gradient Boosting) 9 library are particularly effective for structured, tabular data, with interpretable outputs, and have become the backbone of clinical and epidemiological studies 10 , 11 . XGBoost builds an ensemble of decision trees sequentially, with each tree correcting the errors of the ones before it. The algorithm uses gradient descent to optimise a loss function, ensuring it captures the most important patterns in the data, including non-linear interactions, while keeping overfitting in check. It is highly scalable and fast, and handles missing values automatically, which is a major advantage when working with incomplete real-world datasets like those in healthcare. Regularisation techniques built into XGBoost (L1 and L2 penalties) add another layer of control to keep the model generalizable and robust. Importantly, there is a known issue of missing data in actual clinical practice settings. For predicting treatment outcomes in various TB cases, XGBoost can integrate and analyse clinical, radiological, demographic, and genomic features, identifying subtle patterns and relationships that influence prognosis. Importantly, it provides interpretable insights through feature importance scores, which not only help refine predictions but also highlight the factors that matter most, aiding in more personalised and effective treatment strategies. In this study, we leverage global data from the TB Portal dataset to develop an XGBoost-based machine learning model for predicting clinical treatment outcomes. The model integrates contextual and patient-specific factors that can be collected at various stages of infection, diagnosis, and treatment. This research aims to address key challenges in identifying the critical factors that determine clinical treatment outcomes, thereby contributing to more effective strategies for the management and control of TB globally. Results Demographic data The processed dataset included 8,094 individuals with at least 50% metadata completeness and a known treatment outcome. Of these, 6,097 (75.3%) were cured and 1,997 (24.7%) experienced negative outcomes, defined as death or treatment failure. The median time to outcome was 37 weeks (IQR: 27–78 weeks) for cured patients and 23 weeks (IQR: 8–48 weeks) for those with negative outcomes. Patients were recruited from 13 countries, contributing to the dataset’s diversity. The average age was 43.0 years (SD: 14.1), and the mean BMI was 20.5 kg/m² (SD: 3.7). Notably, a high proportion of patients were unemployed (59.1%), and 628 individuals were recorded as ex-prisoners. Significant differences in treatment outcomes were observed across demographic and clinical characteristics (Table 1 ). For instance, females had a higher success rate (83.3%) than males (72.5%; p = 1.44×10⁻²²), and younger patients (< 20 years) had markedly better outcomes (96.0%) compared to those aged 40 and above, where success dropped below 72% ( p = 4.64×10⁻²⁸). Education level showed a strong gradient: patients with no education had a 56.0% success rate, whereas those with a college education reached 87.2% ( p = 1.60×10⁻⁴¹). Similar disparities were found in employment status, where disabled individuals had the lowest success rate (52.6%) and students the highest (93.8%; p = 9.52×10⁻⁷⁴). HIV-positive patients had significantly poorer outcomes (77.5%) compared to HIV-negative individuals (55.2%; p = 2.35×10⁻⁴³). As expected, drug resistance level was one of the strongest predictors: success dropped from 87.6% in sensitive cases to 58.3% in XDR-TB ( p = 1.75×10⁻¹⁰⁷). Patients with lower BMI (< 20) had worse outcomes (63.4%) than those in higher BMI categories, with success rising to 83.3% for BMI ≥ 30 ( p = 3.46×10⁻²⁷) (Table 1 ). Table 1 Baseline characteristics and clinical profile of tuberculosis patients (n = 8,094) Characteristic Levels N % Successful Failed Chi2 p-value Difference Gender Male 5996 74.1 4350 (72.5%) 1646 (27.5%) 1.44E-22 Female 2098 25.9 1747 (83.3%) 351 (16.7%) Education No education 1408 17.4 789 (56.0%) 619 (44.0%) 1.60E-41 Basic school 2070 25.6 1424 (68.8%) 646 (31.2%) Complete school 1290 15.9 984 (76.3%) 306 (23.7%) College 343 4.2 299 (87.2%) 44 (12.8%) Employment Unemployed 4780 59.1 3520 (73.6%) 1260 (26.4%) 9.52E-74 Self-employed 32 0.4 27 (84.4%) 5 (15.6%) Unofficially employed 85 1.1 54 (63.5%) 31 (36.5%) Employed 1600 19.8 1421 (88.8%) 179 (11.2%) Retired 547 6.8 367 (67.1%) 180 (32.9%) Homemaker 28 0.3 22 (78.6%) 6 (21.4%) Student 130 1.6 122 (93.8%) 8 (6.2%) Disabled 523 6.5 275 (52.6%) 248 (47.4%) HIV Negative 792 9.8 437 (55.2%) 355 (44.8%) 2.35E-43 Positive 7302 90.2 5660 (77.5%) 1642 (22.5%) Type of resistance Sensitive 2727 33.7 2388 (87.6%) 339 (12.4%) 1.75E-107 Mono DR 586 7.2 492 (84.0%) 94 (16.0%) Poly DR 193 2.4 157 (81.3%) 36 (18.7%) MDR 3285 40.6 2306 (70.2%) 979 (29.8%) Pre-XDR 373 4.6 212 (56.8%) 161 (43.2%) XDR 930 11.5 542 (58.3%) 388 (41.7%) Age of onset (years old) < 20 225 2.8 216 (96.0%) 9 (4.0%) 4.64E-28 20–40 3252 40.2 2600 (80.0%) 652 (20.0%) 40–60 3583 44.3 2546 (71.1%) 1037 (28.9%) 60–80 936 11.6 665 (71.0%) 271 (29.0%) 60+ 98 1.2 70 (71.4%) 28 (28.6%) Body mass index (kg/m 2 ) < 20 2592 32 1644 (63.4%) 948 (36.6%) 3.46E-27 20–30 2937 36.3 2249 (76.6%) 688 (23.4%) 30+ 90 1.1 75 (83.3%) 15 (16.7%) Geographic variation was also pronounced. Ukraine and Moldova exhibited the highest treatment failure proportions (38.4% and 31.5%, respectively), while Georgia (9.2%) and Belarus (15.8%) reported substantially better outcomes. Interestingly, Belarus, despite having one of the highest MDR + burdens (79.7%), maintained a lower failure rate than both Moldova and Ukraine. This suggests that disparities in treatment outcomes are influenced not only by drug resistance profiles, but also by systemic factors such as healthcare quality, access to care, and patient support infrastructure ( Supplementary Table 1). The most prominent variables collected from diagnosis were lung localisation features and severity score, resistance and comorbidities. For variables collected during/after treatment, these included Mtb related data, such as drug resistance (XDR: 930 − 11.6%; pre-XDR 373 − 4.6%; MDR: 3285 − 40.6%; poly DR: 193 − 2.4%; mono DR 586 − 7.2%; Sensitive: 2727–33.7%) and lineage (L2 1475–18.2%; L4 1624–20.0%, other 61.8%). The prevalence of MDR and above resistance (MDR+), with Ukraine showing the highest rates of MDR-TB and above level resistance at 77.7%. Survival analysis of treatment outcome To assess the series of features influencing treatment, a survival analysis was performed using a Weibull Accelerated Failure Time (AFT) model, with time to cure as the outcome. Several drugs, including terizidone, capreomycin, kanamycin, levofloxacin, cycloserine, moxifloxacin, and linezolid, were associated with significantly longer treatment durations, suggesting their use in more complex or resistant cases. Notably, treatment failure due to additional resistance also contributed to extended treatment times. Furthermore, certain Mtb lineages, particularly lineages 2 and 4, were linked to prolonged treatment courses, consistent with prior findings of lineage-associated treatment variability. Unexpectedly, higher education levels, increased percentage of abnormal lung volume, and use of pretomanid were associated with a shorter time to treatment completion. These counterintuitive associations may reflect confounding effects related to healthcare access, disease severity, or treatment allocation strategies. Overall, the AFT analysis complements traditional outcome prediction models by capturing the influence of clinical and microbiological variables on treatment duration (Fig. 1 ). Model development and feature selection To predict binary clinical treatment outcomes, we developed an XGBoost model trained on a curated dataset comprising 8,094 cases and 50 features, each with less than 50% missing data. These features were grouped according to their availability at distinct clinical stages. The final input set included 8 demographic, 9 microbiological, 28 imaging (X-ray), and 5 treatment-related features (Table 2 ). This stepwise segmentation improves the model’s robustness to missing data and allows for outcome predictions at each stage of the diagnostic and treatment process. As more clinical information becomes available, the model progressively gains confidence and predictive accuracy. Table 2 Feature level grouping Levels Variables Demographic (8) Education, gender, employment, social risk factors, age of onset, BMI, number of daily contacts, comorbidity Microbiological (9) Type of resistance, case definition, diagnosis code, culture, genexpert test, bactec isoniazid, bactec rifampicin, bactec ethambutol, main lineage X-ray image description (25) Overall percent of abnormal volume, pleural effusion percent of hemithorax involved, Is pleural effusion bilateral, other non-TB abnormalities, Mediastinal lymph nodes present, Collapse, Small cavities, Medium cavities, Large cavities, Is any large cavity belong to a multi-sextant cavity, Can multiple cavities be seen, Infiltrate low ground glass density, Infiltrate medium density, Infiltrate high density, Small nodules, Medium nodules, Large nodules, Huge nodules, Is any calcified or partially calcified nodule exist, I Is any noncalcified nodule exist, Is any clustered nodule exists, Are multiple nodule exists, Low ground glass density active fresh nodules, Medium density stabilised fibrotic nodules, High density calcified typically sequella, Timika score, Lung localisation, Total cavernum Treatment (5) regimen drug, regimen count, period span, outcome, treatment status The detailed explanation for each feature can be found in data dictionary in TB Portal webpage: https://tbportals.niaid.nih.gov/user-guides . Model predictive performance The model demonstrated strong predictive performance, achieving an accuracy of 0.91, an AUC-ROC score of 0.96, an F1 score of 0.94 and other relevant metrics such as precision and recall. These results highlight the model’s effectiveness in distinguishing between clinical outcomes in the unbalanced dataset and its potential utility in guiding decision-making processes when complete information is given Following this, the feature importance scores from the trained model were analysed to identify the most influential predictors contributing to its performance. Key contributors included variables related to demographics (age of onset (score: 29), BMI (21)), lung pathology (Timika Score (22)), microbiological (drug resistance type (18)), and treatment (period span (65), patient stopping treatment (16)). Ranking features by their importance helped to pinpoint the most critical factors influencing the outcome, offering valuable insights into the drivers of treatment success or failure (Table 3 , Supplementary Table 2 ). Table 3 Top importance of variables linked to treatment outcome Feature Level Feature Importance Feature Group Missing values Highest Correlated Feature (Correlation Value) Demographic Age of onset 29 Age of onset 0 (0.0%) Others (0.17) BMI 21 BMI 2475 (30.6%) Diabetes (0.15) No. daily contacts 13 No. daily contacts 2887 (35.7%) Capreomycin (0.17) Education 12 Education 0 (0.0%) GeneXpert test (0.32) Employment 8 Employment 369 (4.6%) Education (0.28) MDR contact 7 Social risk factors 0 (0.0%) No. daily contacts (0.11) Microbiological Resistance type 18 Type of resistance 0 (0.0%) GeneXpert test (0.7) Case definition 12 Case definition 0 (0.0%) Isoniazid (0.29) Culture negative 9 Culture 0 (0.0%) Clofazimine (0.36) X-ray Timika score 22 Timika score 1898 (23.4%) Abnormal vol. % (0.69) Calcified nodule 8 Calcified nodule 0 (0.0%) High density calcified (0.62) Infiltrate low ground glass density 7 Infiltrate low ground glass density 0 (0.0%) Infiltrate medium density (0.5) Treatment Period span 65 Period span 104 (1.3%) Capreomycin (0.35) Patient stopped treatment 16 Treatment tatus 0 (0.0%) Infiltrate high density (0.15) Pretomanid 11 Drug regimen 0 (0.0%) Bedaquiline (0.11) Amoxicillin-clavulanate 8 Drug regimen 0 (0.0%) Imipenem-cilastatin (0.86) Treatment ended 7 Treatment status 0 (0.0%) Not reported-Comorbidity (0.31 Adverse event 6 Treatment status 0 (0.0%) Imipenem-cilastatin (0.17 The detailed explanation for each feature can be found in data dictionary in TB portals webpage: https://tbportals.niaid.nih.gov/user-guides . Full table can be found in Supplementary table 1 . Feature importance and odds ratios To provide epidemiological interpretability and clinical relevance in explanatory modelling, multivariate odds ratios were calculated for features included in the treatment outcome prediction model. While XGBoost's feature importance highlights variables contributing to predictive performance, odds ratios (ORs) offer direct, interpretable estimates of the strength and direction of association between individual features and treatment success. Prior to analysis, collinearity among features was assessed to ensure exclusion of highly correlated features, resulting in a refined set of predictors. Adjusted Odds ratios (AORs) with 95% confidence intervals were computed using logistic regression for continuous and multicategory features, and Fisher’s exact test for binary features. The OR analysis revealed several features with strong, statistically significant associations with treatment outcome. For instance, "Treatment ended" (AOR = 11.11, 95% CI: 7.59–16.27) and “pretomanid” (AOR = 5.57, 95% CI: 2.58–12.02) were associated with markedly increased chances of treatment success, aligning with their high XGBoost importance scores. Similarly, features such as “Culture result - negative” (AOR = 4.31, 95% CI: 3.47–5.35), “Continuation of treatment” (AOR = 1.66, 95% CI: 1.2–2.29), and “Clofazimine” (AOR = 1.94, 95% CI: 1.4–2.7) showed positive associations with favourable outcomes. Conversely, variables such as “Patient stopped treatment” (AOR = 0.11, 95% CI: 0.06–0.22), “Treatment ineffective due to additional resistance” (AOR = 0.29, 95% CI: 0.18–0.45), and “Adverse event” (AOR = 0.33, 95% CI: 0.18–0.61) were associated with significantly increased risks of failure. Interestingly, although variables like “age of onset” (AOR = 0.98, 95% CI: 0.97–0.99) and “BMI” (AOR = 1.04, 95% CI: 1.01–1.07) had modest effect sizes, they were still statistically significant, reinforcing their clinical importance despite subtle individual contributions. These findings illustrate how OR analysis complements ML feature importance by offering interpretable estimates of individual feature effects, while models like XGBoost capture nonlinearities and interactions, providing a more holistic understanding of the determinants of treatment outcome ( Supplementary Table 3 ). Stepwise modelling results Stepwise accuracy analysis examines how the inclusion of features from distinct stages of the diagnostic and treatment process impacts model performance. Hierarchical model features are grouped into four levels based on when they become available: demographic pre-treatment (demographics and socioeconomic information), microbiological (drug resistance and health status), X-ray (imaging-based features like lung localisation and severity scores), and Treatment (treatment and regimen details). By progressively adding features from these levels, the analysis evaluates the model's ability to predict outcomes at each stage, highlighting the value of early information while demonstrating how prediction confidence improves as additional data is incorporated (Models 1 to 4). Model 1 uses only pre-treatment features (demographics and socioeconomic data). Model 2 adds microbiological features (drug resistance and health levels), improving sensitivity and accuracy. Model 3 includes imaging-based features (lung localisation and severity scores), further enhancing performance. Model 4 incorporates all feature levels, including Treatment data (regimen and adherence), achieving the highest metrics. This stepwise progression highlights how additional diagnostic and treatment data improve predictive accuracy. The stepwise accuracy analysis reveals the progressive improvement in model performance as features from successive diagnostic and treatment stages are incorporated (Table 4 ). Model 1, using only pre-treatment features such as demographics and socioeconomic information, achieved a baseline testing accuracy of 0.7165, sensitivity of 0.7115, and AUC-ROC of 0.8048. These metrics reflect the predictive power of basic patient-level data but indicate limitations in capturing more complex clinical dynamics (Table 4 ). Adding microbiological features, including drug resistance profiles and patient health levels, in Model 2 greatly improved sensitivity to 0.8270 and testing accuracy to 0.7925, highlighting the importance of diagnostic information for outcome prediction. Model 3, which incorporates imaging-based features such as lung localisation and severity scores, provided marginal improvements over Model 2, with testing accuracy increasing to 0.8017 and AUC-ROC to 0.8575. This suggests that imaging data adds value but is most impactful when combined with earlier feature levels. Model 4, incorporating all feature levels (except for the image-based feature), achieved the high performance, with a testing accuracy of 0.9067, sensitivity of 0.9212, and an AUC-ROC of 0.9535. These metrics reflect the cumulative benefit of integrating comprehensive patient data, enabling the model to capture complex interactions and improve confidence in predictions. Table 4 Predictive accuracy across the different models* Metric Model 1 Model 2 Model 3 Model 4 All features Number of features 8 17 45 23 50 Testing Accuracy 0.7365 0.7925 0.8017 0.9067 0.9111 Sensitivity (Recall) 0.7377 0.8270 0.8320 0.9212 0.9262 Specificity 0.7293 0.6867 0.7093 0.8622 0.8647 AUC-ROC 0.8027 0.8477 0.8575 0.9535 0.9555 F1-Score 0.8079 0.8573 0.8635 0.9371 0.9401 Model 1 uses only demographic features (demographics and socioeconomic data). Model 2 adds microbiological features (drug resistance and health levels), improving sensitivity and accuracy. Model 3 adds in X-ray based features (lung localisation and severity scores), further enhancing performance. Model 4 incorporates demographic, microbiological and treatment feature levels, including Treatment data (regimen and adherence). This stepwise progression highlights how additional diagnostic and treatment data improve predictive accuracy. Interestingly, including all features together without consideration of feature levels yielded slightly lower performance metrics (e.g., testing accuracy of 0.9111 and sensitivity of 0.9262), underscoring the importance of structured feature inclusion and the potential impact of noise or redundancy in the data. However, image data does show limited ineffectiveness in slightly increasing predictive power. This analysis demonstrates the model’s prediction power at each stage of the clinical admission process, aligning with clinical workflows where data becomes available progressively. Looking at the correlation between features (Fig. 2 ), there is very low correlation between X-ray features and all other features. High correlation exists within X-ray features, but collectively, they do not contribute as much as other variables to the power of the model. Benchmarking with alternative ML models To evaluate the performance of different machine learning approaches using the complete feature set, we compared XGBoost (XGB) with logistic regression, naive Bayes, Support Vector Machines (SVMs), k-Nearest Neighbours (k-NN), and Multi-Layer Perceptron (MLP). Among these models, XGB consistently outperformed others in terms of accuracy, sensitivity, specificity, and AUC-ROC, demonstrating its ability to handle high-dimensional data and capture complex non-linear interactions. SVM and MLP, which inherently model feature interactions, performed comparably to XGB in certain metrics but did not deal with the data imbalance as well. Logistic regression and k-NN, while simpler and interpretable, could not model feature interactions effectively, leading to lower predictive performance. Naive Bayes, with its assumption of feature independence, showed the weakest performance, highlighting its limitations in handling complex clinical datasets. The results underscore the strength of XGB as a robust, flexible model for predicting treatment outcomes while also showcasing the relative strengths and weaknesses of alternative approaches (Table 5 ). Table 5 Comparison of the predictive ability of the XGBoost model and other machine learning approaches Metric Logistic Regression Naive Bayes SVM k-NN MLP XGBoost Testing Accuracy 0.8573 0.7739 0.8481 0.7690 0.8678 0.9074 Sensitivity (Recall) 0.8762 0.8336 0.9025 0.8066 0.9082 0.9189 Specificity 0.7995 0.5915 0.6817 0.6541 0.7444 0.8722 AUC-ROC 0.9075 0.7931 0.8592 N/A 0.8879 0.9555 F1-Score 0.9025 0.8475 0.8995 0.8403 0.9119 0.9373 SVM: Support vector machine; MLP: Multilayer perceptron; k-NN: k nearest neighbour; XGBoost: Extreme gradient boosting Discussion The stepwise approach employed in this study closely mirrors the clinical timeline, making it particularly relevant and relatable for healthcare providers. Early-stage features, such as demographics and socioeconomic information, are essential for initial risk stratification, enabling clinicians to identify patients who may require closer monitoring or additional resources. For instance, using only early-stage features, the model achieved an accuracy of 71.65%, demonstrating the utility of even limited data for risk stratification. Microbiological data, including drug resistance profiles and patient health metrics, further enhance the model's specificity in identifying high-risk cases, providing valuable insights for tailoring treatment strategies. Incorporating these features improved the model’s accuracy to 80.42%, highlighting the significant value of diagnostic data. As more data becomes available, such as imaging results and treatment details, predictions are refined and confidence in outcomes increases. This progression is evidenced by the model's performance, which peaked at an accuracy of 90.86% when all feature levels were included. This progressive integration of data aligns with real-world clinical workflows, supporting decision-making at every stage of the diagnostic and treatment process. While the stepwise approach demonstrates the model’s ability to improve prediction as more data becomes available, certain late-stage features warrant careful interpretation. Period span, which captures how long a patient has already been on treatment, can significantly boost model performance but may primarily reflect retrospective information. In clinical practice, a prolonged treatment duration often signals a complex or failing case, which may already be evident to healthcare providers without the aid of a predictive model. However, period span is also a temporally evolving feature. As part of a longitudinal decision-support framework, it can be progressively incorporated into the model, allowing predictions to adapt over time. This dynamic integration supports the model’s role not only at the point of diagnosis but also throughout the treatment course, offering updated risk estimates as new clinical data becomes available. Machine learning (ML) has been increasingly applied to predictive modelling in healthcare, demonstrating its utility in outcome prediction, risk stratification, and clinical decision support. XGBoost, in particular, has shown significant advantages when applied to structured, tabular datasets like those used in this study. Compared to other ML methods, XGBoost excels in handling high-dimensional data, capturing non-linear feature interactions, and maintaining strong performance even with imbalanced datasets 9 . XGBoost outperformed other models such as logistic regression and naive Bayes, achieving a testing accuracy of 90.74% compared to 85.73% and 77.39%, respectively. One of its key strengths is its ability to manage missing data effectively, a common challenge in healthcare datasets. Studies have highlighted XGBoost’s ability to impute missing values during the training process, which makes it especially suited for stepwise approaches that deal with progressively available clinical data and low-resource setting. Additionally, feature importance analysis within XGBoost provides interpretable insights, allowing clinicians to understand which variables drive predictions and how these relate to clinical outcomes. Such interpretability is critical for aligning ML outputs with clinical reasoning and improving trust in predictive models. The feature importance assessment revealed known factors that affect clinical treatment outcomes, including treatment duration, age of onset, frequency of receiving anti-TB medication and BMI. Overall, this study highlights the value of stepwise machine learning models in mirroring clinical workflows and supporting outcome prediction at multiple stages of TB management. By integrating progressively available data, such models can enhance early risk stratification and adapt dynamically throughout treatment, offering a practical tool for personalised, data-driven care. Methods TB Portal dataset The dataset for this study was obtained from the TB Portal database, a global open-access resource containing comprehensive clinical, radiological, genomic, and demographic data on TB patients. The detailed explanation for each feature can be found in the data dictionary for the database ( https://tbportals.niaid.nih.gov/user-guides ). Features with more than 50% of missing values were dropped. The country feature was also dropped to improve the generalisability of the model. After cleaning, 8094 data points with 51 features remain. Out of the features, 17 features with clear hierarchical relationships in the data were transformed using ordinal encoding ( Supplementary Table 4 ), and 7 features contain comma-separated categorical terms. After one-hot encoding of the terms, 166 features were used to train the model ( Supplementary Table 5 ). Features were categorised into four levels based on their availability at different stages of the diagnostic and treatment process: pre-treatment (demographics and socioeconomic data), microbiological (drug resistance and health status), X-ray (imaging-based features such as lung localisation and severity scores), and treatment (regimen and adherence details). Preprocessing steps included handling missing data using a most frequent value imputation strategy with the Simple Imputer. Features with near-zero variance were removed using a variance threshold filter with a threshold of 0.01. Collinearity was assessed to ensure robust model interpretability, with highly correlated features excluded from specific analyses. Time to outcome analyses To assess factors associated with treatment duration, we applied an Accelerated Failure Time (AFT) model using a Weibull distribution. The analysis focused on time to cure, which was selected as the event of interest due to its higher representation in the dataset compared to failure or death. Patients with negative outcomes were treated as censored observations. Predictor variables included clinical, demographic, and treatment-related features, with continuous variables standardised and categorical variables encoded as ordinal or binary depending on their clinical context. Model coefficients were interpreted as time ratios, indicating whether a given feature was associated with a longer or shorter time to cure. Statistical significance was determined using p-values (threshold: p < 0.05). The analysis was performed using the lifelines package in Python. Model Development and Evaluation An XGBoost (Extreme Gradient Boosting) model was developed to predict binary treatment outcomes, leveraging its ability to handle high-dimensional data, capture non-linear feature interactions, and manage missing values. The data was split into training and testing sets using an 80 − 20 stratified split, and RandomOverSampler was applied to the training data to address class imbalance. The importance of each feature in the XGBoost model was determined using weight-based feature importance, which reflects the frequency of a feature being used in tree splits. Feature importance rankings were used to identify key predictors influencing treatment outcomes. A stepwise approach was used to assess the incremental impact of feature levels on predictive performance. Features were grouped by their availability during the diagnostic and treatment process (pre-treatment, microbiological, X-ray, and Treatment) and systematically added to the model. The evolution of performance metrics, such as accuracy, sensitivity, specificity, and AUC-ROC, was tracked to evaluate the contribution of each feature level. An advantage of the approach is that the resulting trees were visually inspected and interpreted. For example, see Supplementary Fig. 1 , which shows a tree that splits first on “treatment ended”, followed by other key features, including regimen count, education, and pretomanid, indicating their importance in early classification. The structure also reveals how missing values are handled and how variables such as Patient drug abuse, age of onset, and employment contribute directionally to the outcome. Odds ratio analysis To provide clinically interpretable insights, we performed an odds ratio analysis on all features present in the modelling dataset. Binary features were assessed using Fisher’s exact test to compute crude odds ratios and corresponding p-values. For continuous and multi-categorical features, logistic regression models were fitted with the outcome as the dependent variable, and adjusted odds ratios (AORs) were obtained by exponentiating the model coefficients. Confidence intervals (95%) were derived from the logistic model estimates. This approach allowed consistent inclusion of both binary and non-binary variables without requiring binarization. A variance inflation factor (VIF) analysis was conducted prior to modelling to eliminate highly collinear features, and only complete cases (rows without missing values) were used. Abbreviations Full Term TB Tuberculosis Mtb Mycobacterium tuberculosis RR-TB Rifampicin-resistant tuberculosis MDR-TB Multidrug-resistant tuberculosis XDR-TB Extensively drug-resistant tuberculosis CT Computed tomography ML Machine learning XGB XGBoost (Extreme Gradient Boosting) SVM Support Vector Machine k-NN k-Nearest Neighbour MLP Multi-Layer Perceptron AUC-ROC Area under the receiver operating characteristic curve F1-score F1 harmonic mean of precision and recall OR Odds ratio AOR Adjusted odds ratio CI Confidence interval BMI Body mass index IQR Interquartile range SD Standard deviation AFT Accelerated Failure Time VIF Variance Inflation Factor WHO World Health Organization Declarations Ethics approval and consent to participate This study did not involve the collection of new human or animal data. All analyses were conducted on de-identified, publicly available data from the TB Portals program (https://tbportals.niaid.nih.gov), an open-access resource supported by the U.S. National Institute of Allergy and Infectious Diseases. The TB Portals dataset is curated in accordance with ethical standards, including removal of personal identifiers, and is made available for research under the program’s data-sharing policies. As no direct patient contact or intervention was performed by the authors, additional institutional ethical approval was not required. This study was conducted in accordance with the ethical principles set out in the Declaration of Helsinki. Consent to Participate declaration Not applicable. Consent for publication All authors have read and approved the final manuscript. They consent to the publication of this work and confirm that the content is original and has not been published or submitted for publication elsewhere. Competing interests No potential conflict of interest was reported by the authors. Funding LW is funded by a BBSRC LIDO studentship (Ref. BB/T008709/1). TGC and SC are funded by the UKRI (BBSRC BB/X018156/1; MRC MR/R020973/1, MRC MR/X005895/1; EPSRC EP/Y018842/1)). The funders had no role in the study design, data collection and analysis, the decision to publish, or the preparation of the manuscript. The authors declare that they have no conflicts of interest. Author Contribution LW and JEP conceived and directed the project. LW developed the models under the supervision of SC, TGC and JEP. LW wrote the first draft of the manuscript. All authors commented on and edited various versions of the draft manuscript and approved the final manuscript. LW, TGC and JEP compiled the final manuscript. Data Availability Not data collection was done. All data used is from online database TB portal. All data is available upon request from TB portal: https://tbportals.niaid.nih.gov/ The code and model can be found in the author’s Github: https://github.com/linfeng-wang/TBpt References Global Tuberculosis Report. 2023. https://www.who.int/teams/global-tuberculosis-programme/tb-reports/global-tuberculosis-report-2023 WHO. Who Revised Definitions and Reporting Framework for Tuberculosis. Eurosurveillance vol. 18. (2013). Salindri AD, et al. HIV co-infection increases the risk of post-tuberculosis mortality among persons who initiated treatment for drug-resistant tuberculosis. Sci Rep. 2024;14:23834. Boadu AA, Yeboah-Manu M, Osei-Wusu S, Yeboah-Manu D. Tuberculosis and diabetes mellitus: The complexity of the comorbid interactions. Int J Infect Dis. 2024;146:107140. Wang EY, Arrazola RA, Mathema B, Ahluwalia IB, Mase SR. The impact of smoking on tuberculosis treatment outcomes: a meta-analysis. Int J Tuberc Lung Dis. 2020;24:170–5. Jin S, et al. A Predictive Model for the 10-year Overall Survival Status of Patients With Distant Metastases From Differentiated Thyroid Cancer Using XGBoost Algorithm-A Population-Based Analysis. Front Genet. 2022;13:896805. Abd Al Rahman E, Ruhaiyem NIR, Bouchahma M. A multioutput classifier model for breast cancer treatment prediction. Intelligence-Based Med. 2024;10:100158. The TB. Portals: an Open-Access, Web-Based Platform for Global Drug-Resistant-Tuberculosis Data Sharing and Analysis | Journal of Clinical Microbiology. https://journals.asm.org/doi/ 10.1128/jcm.01013-17 Chen T, Guestrin C, XGBoost:. A Scalable Tree Boosting System. in Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining 785–794Association for Computing Machinery, New York, NY, USA, (2016). 10.1145/2939672.2939785 Li B, et al. Using Machine Learning (XGBoost) to Predict Outcomes After Infrainguinal Bypass for Peripheral Artery Disease. Ann Surg. 2024;279:705–13. Wang R, Zhang J, Shan B, He M, Xu J. XGBoost Machine Learning Algorithm for Prediction of Outcome in Aneurysmal Subarachnoid Hemorrhage. Neuropsychiatr Dis Treat. 2022;18:659–67. Additional Declarations No competing interests reported. Supplementary Files Supplementaryinformation.docx Cite Share Download PDF Status: Posted Version 1 posted You are reading this latest preprint version Research Square lets you share your work early, gain feedback from the community, and start making changes to your manuscript prior to peer review in a journal. As a division of Research Square Company, we’re committed to making research communication faster, fairer, and more useful. We do this by developing innovative software and high quality services for the global research community. Our growing team is made up of researchers and industry professionals working together to solve the most critical problems facing scientific publishing. Also discoverable on Platform About Our Team In Review Editorial Policies Advisory Board Help Center Resources Author Services Accessibility API Access RSS feed Manage Cookie Preferences © Research Square 2026 | ISSN 2693-5015 (online) Privacy Policy Terms of Service Do Not Sell My Personal Information {"props":{"pageProps":{"initialData":{"identity":"rs-7558046","acceptedTermsAndConditions":true,"allowDirectSubmit":true,"archivedVersions":[],"articleType":"Research Article","associatedPublications":[],"authors":[{"id":530428049,"identity":"1c1acd93-5013-471d-9c2f-805b72ba2ace","order_by":0,"name":"Linfeng Wang","email":"","orcid":"","institution":"London School of Hygiene \u0026 Tropical Medicine","correspondingAuthor":false,"prefix":"","firstName":"Linfeng","middleName":"","lastName":"Wang","suffix":""},{"id":530428051,"identity":"649787e9-fb11-4af0-aa65-bf35829f6640","order_by":1,"name":"Susana Campino","email":"","orcid":"","institution":"London School of Hygiene \u0026 Tropical Medicine","correspondingAuthor":false,"prefix":"","firstName":"Susana","middleName":"","lastName":"Campino","suffix":""},{"id":530428052,"identity":"bf93fa37-abf2-4877-9d1b-cd9c2c6d23d8","order_by":2,"name":"Taane G. Clark","email":"","orcid":"","institution":"London School of Hygiene \u0026 Tropical Medicine","correspondingAuthor":false,"prefix":"","firstName":"Taane","middleName":"G.","lastName":"Clark","suffix":""},{"id":530428053,"identity":"a9d5830c-2ece-4d1c-afd4-822a3a57ec78","order_by":3,"name":"Jody E. Phelan","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAABAElEQVRIiWNgGAWjYBAC9gYGAyB1gIGPgYHxwQMgAwoScGphhGlhY2BgNkhgOCBBkhY2CeK0tDdvk2DccUeOjf3ssYqEP3fqdBuYH35gbEvDraXnWJkE45lnxmw8eWk3EtueSZgdYDOWYGzLwa1lRo4ZUMHhxDaGHLMbiQ2HgVoYzBgY2yoIaqlv439jVpDwB6SF/RteLYJQLQlsEjlmDAlsIC08IFtwO0ya51ixReKZw4ZtEm+MJRLbDktuO8xTLJFwDrf3+dibN974uOOwPD9/juGHD38O85sdb9/44UNZMk4tQMAikdiAzGdmwBcrECUfGBvwqxgFo2AUjIIRDgD6/FaYoZFAAgAAAABJRU5ErkJggg==","orcid":"","institution":"London School of Hygiene \u0026 Tropical Medicine","correspondingAuthor":true,"prefix":"","firstName":"Jody","middleName":"E.","lastName":"Phelan","suffix":""}],"badges":[],"createdAt":"2025-09-07 18:23:14","currentVersionCode":1,"declarations":"","doi":"10.21203/rs.3.rs-7558046/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-7558046/v1","draftVersion":[],"editorialEvents":[],"editorialNote":"","failedWorkflow":false,"files":[{"id":93881749,"identity":"c3c32746-6aa5-4fb0-80b9-fbb2d40fa184","added_by":"auto","created_at":"2025-10-19 16:50:36","extension":"docx","order_by":0,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":765084,"visible":true,"origin":"","legend":"","description":"","filename":"TBptdraft5sub.docx","url":"https://assets-eu.researchsquare.com/files/rs-7558046/v1/f26ede944000f1639ae2437a.docx"},{"id":93883506,"identity":"1b6df95c-2fac-4b81-a0b0-0fc439dc759c","added_by":"auto","created_at":"2025-10-19 17:06:36","extension":"json","order_by":1,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":6512,"visible":true,"origin":"","legend":"","description":"","filename":"81e6125e0c1d4a59a106d33dc9f8364e.json","url":"https://assets-eu.researchsquare.com/files/rs-7558046/v1/7e13090b2f9ade84728475f9.json"},{"id":93883507,"identity":"da531c97-e09c-45e9-83c5-f3d73b244475","added_by":"auto","created_at":"2025-10-19 17:06:36","extension":"docx","order_by":2,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":576059,"visible":true,"origin":"","legend":"","description":"","filename":"Supplementaryinformation.docx","url":"https://assets-eu.researchsquare.com/files/rs-7558046/v1/73314c4143f5d41450382d0a.docx"},{"id":93881741,"identity":"0a6b8d9d-a5b3-4815-9ca6-20a85f0e1ffc","added_by":"auto","created_at":"2025-10-19 16:50:36","extension":"xml","order_by":3,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":100324,"visible":true,"origin":"","legend":"","description":"","filename":"81e6125e0c1d4a59a106d33dc9f8364e1enriched.xml","url":"https://assets-eu.researchsquare.com/files/rs-7558046/v1/0ff0dcffe5ae794100ffb08c.xml"},{"id":93883236,"identity":"ad36b180-4ef7-467b-b6f2-0fca016300aa","added_by":"auto","created_at":"2025-10-19 16:58:36","extension":"png","order_by":6,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":14957,"visible":true,"origin":"","legend":"","description":"","filename":"Onlinefloatimage1.png","url":"https://assets-eu.researchsquare.com/files/rs-7558046/v1/589a033cdfd53ffc94c57756.png"},{"id":93883240,"identity":"214e7a7b-3d35-47ab-98ec-8f6e54d5741c","added_by":"auto","created_at":"2025-10-19 16:58:36","extension":"png","order_by":7,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":71051,"visible":true,"origin":"","legend":"","description":"","filename":"Onlinefloatimage2.png","url":"https://assets-eu.researchsquare.com/files/rs-7558046/v1/916d586698999e0f72ba1e83.png"},{"id":93883238,"identity":"268f2f46-0189-43f9-a47a-0e0effceb54a","added_by":"auto","created_at":"2025-10-19 16:58:36","extension":"xml","order_by":8,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":97800,"visible":true,"origin":"","legend":"","description":"","filename":"81e6125e0c1d4a59a106d33dc9f8364e1structuring.xml","url":"https://assets-eu.researchsquare.com/files/rs-7558046/v1/3fe94f6bca2904959c566e28.xml"},{"id":93881747,"identity":"68929bb5-8dba-4315-b6f5-aa1e009d9105","added_by":"auto","created_at":"2025-10-19 16:50:36","extension":"html","order_by":9,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":106926,"visible":true,"origin":"","legend":"","description":"","filename":"earlyproof.html","url":"https://assets-eu.researchsquare.com/files/rs-7558046/v1/09b4317deaf5a0631290c3b6.html"},{"id":93881740,"identity":"02acb1c4-60fd-49c0-abe3-d38b109f779c","added_by":"auto","created_at":"2025-10-19 16:50:36","extension":"png","order_by":1,"title":"Figure 1","display":"","copyAsset":false,"role":"figure","size":54009,"visible":true,"origin":"","legend":"\u003cp\u003e\u003cstrong\u003eAccelerated Failure Time (AFT) model coefficients for features influencing time to treatment cure.\u003c/strong\u003e\u003c/p\u003e","description":"","filename":"floatimage1.png","url":"https://assets-eu.researchsquare.com/files/rs-7558046/v1/350ff0e7c1790eb207f76374.png"},{"id":93881745,"identity":"b42c3c86-02b9-4536-a861-20baed926534","added_by":"auto","created_at":"2025-10-19 16:50:36","extension":"png","order_by":2,"title":"Figure 2","display":"","copyAsset":false,"role":"figure","size":615739,"visible":true,"origin":"","legend":"\u003cp\u003e\u003cstrong\u003eFeature Correlation\u003c/strong\u003e\u003c/p\u003e","description":"","filename":"floatimage2.png","url":"https://assets-eu.researchsquare.com/files/rs-7558046/v1/3beac1d947889cc0bb9761a1.png"},{"id":97952946,"identity":"ede4060d-ee3b-402e-8faf-057b838a66f6","added_by":"auto","created_at":"2025-12-11 07:24:39","extension":"pdf","order_by":0,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":1815191,"visible":true,"origin":"","legend":"","description":"","filename":"manuscript.pdf","url":"https://assets-eu.researchsquare.com/files/rs-7558046/v1/6470cddd-b54d-428f-a5ce-155855e1d299.pdf"},{"id":93881746,"identity":"c1de4560-23be-40df-9b29-27062a318264","added_by":"auto","created_at":"2025-10-19 16:50:36","extension":"docx","order_by":0,"title":"","display":"","copyAsset":false,"role":"supplement","size":576059,"visible":true,"origin":"","legend":"","description":"","filename":"Supplementaryinformation.docx","url":"https://assets-eu.researchsquare.com/files/rs-7558046/v1/101e098c92e8b56a612bf48c.docx"}],"financialInterests":"No competing interests reported.","formattedTitle":"A multi-stage machine learning framework for stepwise prediction of tuberculosis treatment outcomes: Integrating gradient boosted decision trees and feature-level analysis for clinical decision support","fulltext":[{"header":"Introduction","content":"\u003cp\u003eTuberculosis (TB), caused by \u003cem\u003eMycobacterium tuberculosis\u003c/em\u003e (\u003cem\u003eMtb\u003c/em\u003e), remains a significant global health challenge. In 2023, approximately 10.8\u0026nbsp;million individuals contracted TB, and 1.3\u0026nbsp;million succumbed to the disease\u003csup\u003e\u003cspan citationid=\"CR1\" class=\"CitationRef\"\u003e1\u003c/span\u003e\u003c/sup\u003e. The emergence of drug-resistant \u003cem\u003eMtb\u003c/em\u003e strains has exacerbated this crisis. Globally, about 3.4% of new TB cases and 18% of previously treated cases exhibit resistance to rifampicin (RR-TB), with many also resistant to isoniazid, classifying them as multidrug-resistant TB (MDR-TB)\u003csup\u003e\u003cspan citationid=\"CR1\" class=\"CitationRef\"\u003e1\u003c/span\u003e,\u003cspan citationid=\"CR2\" class=\"CitationRef\"\u003e2\u003c/span\u003e\u003c/sup\u003e. Alarmingly, 6.2% of MDR-TB/RR-TB cases progress to extensively drug-resistant TB (XDR-TB), characterised by additional resistance to fluoroquinolones and at least one Group A drug, such as bedaquiline or linezolid\u003csup\u003e\u003cspan citationid=\"CR1\" class=\"CitationRef\"\u003e1\u003c/span\u003e\u003c/sup\u003e.\u003c/p\u003e\u003cp\u003eSeveral interrelated factors significantly influence TB treatment outcomes, including patient-related conditions such as HIV infection, comorbidities like diabetes, alcoholism, and cancer, as well as nutritional status. Treatment-related variables such as adherence to drug regimens and the presence of drug resistance further complicate the clinical picture. Socio-economic factors, including unemployment and limited access to healthcare, also contribute to poorer outcomes. Populations affected by conditions like HIV, diabetes, and smoking are particularly vulnerable\u003csup\u003e\u003cspan additionalcitationids=\"CR4\" citationid=\"CR3\" class=\"CitationRef\"\u003e3\u003c/span\u003e\u0026ndash;\u003cspan citationid=\"CR5\" class=\"CitationRef\"\u003e5\u003c/span\u003e\u003c/sup\u003e, as these complications are known to worsen treatment response. This complexity and variability in patient outcomes highlight the urgent need for predictive tools. Machine learning models can integrate diverse patient data and anticipate treatment trajectories, offering a pathway toward more personalised and effective TB care. Such methods have been employed successfully in other fields, such as cancer treatment and survival prediction\u003csup\u003e\u003cspan citationid=\"CR6\" class=\"CitationRef\"\u003e6\u003c/span\u003e,\u003cspan citationid=\"CR7\" class=\"CitationRef\"\u003e7\u003c/span\u003e\u003c/sup\u003e. Traditional diagnostic and therapeutic approaches in TB often fall short in addressing the complexities of drug-resistant \u003cem\u003eMtb\u003c/em\u003e and the diverse responses among patients. This highlights the necessity for innovative solutions that can provide rapid, accurate, and cost-effective insights into treatment dynamics.\u003c/p\u003e\u003cp\u003eThe TB Portal database\u003csup\u003e\u003cspan citationid=\"CR8\" class=\"CitationRef\"\u003e8\u003c/span\u003e\u003c/sup\u003e is a global open-access platform designed to facilitate the sharing and analysis of comprehensive data on drug-resistant TB. Developed through an international collaboration of clinicians, radiologists, microbiologists, and data scientists, it currently includes data from 15,997 patient cases across high-burden countries, such as Azerbaijan, Belarus, Georgia, Moldova, and Romania. The dataset captures diverse clinical, radiological, demographic, and socioeconomic features, providing a detailed foundation for studying TB. It includes metrics on lung pathology, such as cavity sizes, nodule types, and infiltrate densities, alongside patient comorbidities like diabetes, HIV, and anaemia. Treatment-related details, including regimen composition, adverse events, and resistance profiles, are extensively documented. Additionally, demographic attributes such as age of onset, gender, education level, and social risk factors (e.g., homelessness, migrant status, or documented MDR contact) are recorded, along with diagnostic data from GeneXpert and drug sensitivity tests and genomic classifications of \u003cem\u003eMtb\u003c/em\u003e lineages\u003csup\u003e\u003cspan citationid=\"CR8\" class=\"CitationRef\"\u003e8\u003c/span\u003e\u003c/sup\u003e.\u003c/p\u003e\u003cp\u003eA significant portion of the cases in the TB Portal database involve MDR-TB (43%) or XDR-TB (9%). The database incorporates imaging data for many cases, including X-rays (11%) and computed tomography (CT) scans (85%). Genomic insights further enrich the dataset, detailing \u003cem\u003eMtb\u003c/em\u003e mutations that confer resistance to critical drugs, such as isoniazid and rifampicin. This public, curated, and standardised dataset makes it a powerful resource for applying machine learning (ML) methods to predict treatment outcomes and uncover the factors driving TB progression and response to therapy \u003csup\u003e\u003cspan citationid=\"CR8\" class=\"CitationRef\"\u003e8\u003c/span\u003e\u003c/sup\u003e. Amongst these ML approaches, decision trees implemented through the XGBoost (Extreme Gradient Boosting)\u003csup\u003e\u003cspan citationid=\"CR9\" class=\"CitationRef\"\u003e9\u003c/span\u003e\u003c/sup\u003e library are particularly effective for structured, tabular data, with interpretable outputs, and have become the backbone of clinical and epidemiological studies\u003csup\u003e\u003cspan citationid=\"CR10\" class=\"CitationRef\"\u003e10\u003c/span\u003e,\u003cspan citationid=\"CR11\" class=\"CitationRef\"\u003e11\u003c/span\u003e\u003c/sup\u003e.\u003c/p\u003e\u003cp\u003eXGBoost builds an ensemble of decision trees sequentially, with each tree correcting the errors of the ones before it. The algorithm uses gradient descent to optimise a loss function, ensuring it captures the most important patterns in the data, including non-linear interactions, while keeping overfitting in check. It is highly scalable and fast, and handles missing values automatically, which is a major advantage when working with incomplete real-world datasets like those in healthcare. Regularisation techniques built into XGBoost (L1 and L2 penalties) add another layer of control to keep the model generalizable and robust. Importantly, there is a known issue of missing data in actual clinical practice settings. For predicting treatment outcomes in various TB cases, XGBoost can integrate and analyse clinical, radiological, demographic, and genomic features, identifying subtle patterns and relationships that influence prognosis. Importantly, it provides interpretable insights through feature importance scores, which not only help refine predictions but also highlight the factors that matter most, aiding in more personalised and effective treatment strategies.\u003c/p\u003e\u003cp\u003eIn this study, we leverage global data from the TB Portal dataset to develop an XGBoost-based machine learning model for predicting clinical treatment outcomes. The model integrates contextual and patient-specific factors that can be collected at various stages of infection, diagnosis, and treatment. This research aims to address key challenges in identifying the critical factors that determine clinical treatment outcomes, thereby contributing to more effective strategies for the management and control of TB globally.\u003c/p\u003e"},{"header":"Results","content":"\u003cdiv id=\"Sec3\" class=\"Section2\"\u003e\u003ch2\u003eDemographic data\u003c/h2\u003e\u003cp\u003eThe processed dataset included 8,094 individuals with at least 50% metadata completeness and a known treatment outcome. Of these, 6,097 (75.3%) were cured and 1,997 (24.7%) experienced negative outcomes, defined as death or treatment failure. The median time to outcome was 37 weeks (IQR: 27\u0026ndash;78 weeks) for cured patients and 23 weeks (IQR: 8\u0026ndash;48 weeks) for those with negative outcomes. Patients were recruited from 13 countries, contributing to the dataset\u0026rsquo;s diversity. The average age was 43.0 years (SD: 14.1), and the mean BMI was 20.5 kg/m\u0026sup2; (SD: 3.7). Notably, a high proportion of patients were unemployed (59.1%), and 628 individuals were recorded as ex-prisoners. Significant differences in treatment outcomes were observed across demographic and clinical characteristics (Table\u0026nbsp;\u003cspan refid=\"Tab1\" class=\"InternalRef\"\u003e1\u003c/span\u003e). For instance, females had a higher success rate (83.3%) than males (72.5%; \u003cem\u003ep\u003c/em\u003e\u0026thinsp;=\u0026thinsp;1.44\u0026times;10⁻\u0026sup2;\u0026sup2;), and younger patients (\u0026lt;\u0026thinsp;20 years) had markedly better outcomes (96.0%) compared to those aged 40 and above, where success dropped below 72% (\u003cem\u003ep\u003c/em\u003e\u0026thinsp;=\u0026thinsp;4.64\u0026times;10⁻\u0026sup2;⁸). Education level showed a strong gradient: patients with no education had a 56.0% success rate, whereas those with a college education reached 87.2% (\u003cem\u003ep\u003c/em\u003e\u0026thinsp;=\u0026thinsp;1.60\u0026times;10⁻⁴\u0026sup1;). Similar disparities were found in employment status, where disabled individuals had the lowest success rate (52.6%) and students the highest (93.8%; \u003cem\u003ep\u003c/em\u003e\u0026thinsp;=\u0026thinsp;9.52\u0026times;10⁻⁷⁴). HIV-positive patients had significantly poorer outcomes (77.5%) compared to HIV-negative individuals (55.2%; \u003cem\u003ep\u003c/em\u003e\u0026thinsp;=\u0026thinsp;2.35\u0026times;10⁻⁴\u0026sup3;). As expected, drug resistance level was one of the strongest predictors: success dropped from 87.6% in sensitive cases to 58.3% in XDR-TB (\u003cem\u003ep\u003c/em\u003e\u0026thinsp;=\u0026thinsp;1.75\u0026times;10⁻\u0026sup1;⁰⁷). Patients with lower BMI (\u0026lt;\u0026thinsp;20) had worse outcomes (63.4%) than those in higher BMI categories, with success rising to 83.3% for BMI\u0026thinsp;\u0026ge;\u0026thinsp;30 (\u003cem\u003ep\u003c/em\u003e\u0026thinsp;=\u0026thinsp;3.46\u0026times;10⁻\u0026sup2;⁷) (Table\u0026nbsp;\u003cspan refid=\"Tab1\" class=\"InternalRef\"\u003e1\u003c/span\u003e).\u003c/p\u003e\u003cp\u003e\u003cdiv class=\"gridtable\"\u003e\u003ctable float=\"Yes\" id=\"Tab1\" border=\"1\"\u003e\u003ccaption language=\"En\"\u003e\u003cdiv class=\"CaptionNumber\"\u003eTable 1\u003c/div\u003e\u003cdiv class=\"CaptionContent\"\u003e\u003cp\u003eBaseline characteristics and clinical profile of tuberculosis patients (n\u0026thinsp;=\u0026thinsp;8,094)\u003c/p\u003e\u003c/div\u003e\u003c/caption\u003e\u003ccolgroup cols=\"7\"\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c1\" colnum=\"1\"\u003e\u003c/div\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c2\" colnum=\"2\"\u003e\u003c/div\u003e\u003cdiv align=\"char\" char=\".\" class=\"colspec\" colname=\"c3\" colnum=\"3\"\u003e\u003c/div\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c4\" colnum=\"4\"\u003e\u003c/div\u003e\u003cdiv align=\"char\" char=\".\" class=\"colspec\" colname=\"c5\" colnum=\"5\"\u003e\u003c/div\u003e\u003cdiv align=\"char\" char=\".\" class=\"colspec\" colname=\"c6\" colnum=\"6\"\u003e\u003c/div\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c7\" colnum=\"7\"\u003e\u003c/div\u003e\u003cthead\u003e\u003ctr\u003e\u003cth align=\"left\" colname=\"c1\"\u003e\u003cp\u003eCharacteristic\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c2\"\u003e\u003cp\u003eLevels\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c3\"\u003e\u003cp\u003eN\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c4\"\u003e\u003cp\u003e%\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c5\"\u003e\u003cp\u003eSuccessful\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c6\"\u003e\u003cp\u003eFailed\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c7\"\u003e\u003cp\u003eChi2 p-value\u003c/p\u003e\u003cp\u003eDifference\u003c/p\u003e\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\" morerows=\"1\" rowspan=\"2\"\u003e\u003cp\u003eGender\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eMale\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e5996\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e74.1\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e4350 (72.5%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e1646 (27.5%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c7\" morerows=\"1\" rowspan=\"2\"\u003e\u003cp\u003e1.44E-22\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eFemale\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e2098\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e25.9\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e1747 (83.3%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e351 (16.7%)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\" morerows=\"3\" rowspan=\"4\"\u003e\u003cp\u003eEducation\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eNo education\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e1408\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e17.4\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e789 (56.0%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e619 (44.0%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c7\" morerows=\"3\" rowspan=\"4\"\u003e\u003cp\u003e1.60E-41\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eBasic school\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e2070\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e25.6\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e1424 (68.8%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e646 (31.2%)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eComplete school\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e1290\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e15.9\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e984 (76.3%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e306 (23.7%)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eCollege\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e343\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e4.2\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e299 (87.2%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e44 (12.8%)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\" morerows=\"7\" rowspan=\"8\"\u003e\u003cp\u003eEmployment\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eUnemployed\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e4780\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e59.1\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e3520 (73.6%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e1260 (26.4%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c7\" morerows=\"7\" rowspan=\"8\"\u003e\u003cp\u003e9.52E-74\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eSelf-employed\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e32\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e0.4\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e27 (84.4%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e5 (15.6%)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eUnofficially employed\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e85\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e1.1\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e54 (63.5%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e31 (36.5%)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eEmployed\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e1600\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e19.8\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e1421 (88.8%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e179 (11.2%)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eRetired\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e547\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e6.8\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e367 (67.1%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e180 (32.9%)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eHomemaker\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e28\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e0.3\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e22 (78.6%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e6 (21.4%)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eStudent\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e130\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e1.6\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e122 (93.8%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e8 (6.2%)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eDisabled\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e523\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e6.5\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e275 (52.6%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e248 (47.4%)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\" morerows=\"1\" rowspan=\"2\"\u003e\u003cp\u003eHIV\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eNegative\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e792\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e9.8\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e437 (55.2%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e355 (44.8%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c7\" morerows=\"1\" rowspan=\"2\"\u003e\u003cp\u003e2.35E-43\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003ePositive\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e7302\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e90.2\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e5660 (77.5%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e1642 (22.5%)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\" morerows=\"5\" rowspan=\"6\"\u003e\u003cp\u003eType of resistance\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eSensitive\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e2727\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e33.7\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e2388 (87.6%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e339 (12.4%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c7\" morerows=\"5\" rowspan=\"6\"\u003e\u003cp\u003e1.75E-107\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eMono DR\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e586\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e7.2\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e492 (84.0%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e94 (16.0%)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003ePoly DR\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e193\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e2.4\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e157 (81.3%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e36 (18.7%)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eMDR\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e3285\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e40.6\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e2306 (70.2%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e979 (29.8%)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003ePre-XDR\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e373\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e4.6\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e212 (56.8%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e161 (43.2%)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eXDR\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e930\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e11.5\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e542 (58.3%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e388 (41.7%)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\" morerows=\"4\" rowspan=\"5\"\u003e\u003cp\u003eAge of onset (years old)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003e\u0026lt;\u0026thinsp;20\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e225\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e2.8\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e216 (96.0%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e9 (4.0%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c7\" morerows=\"4\" rowspan=\"5\"\u003e\u003cp\u003e4.64E-28\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003e20\u0026ndash;40\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e3252\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e40.2\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e2600 (80.0%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e652 (20.0%)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003e40\u0026ndash;60\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e3583\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e44.3\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e2546 (71.1%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e1037 (28.9%)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003e60\u0026ndash;80\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e936\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e11.6\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e665 (71.0%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e271 (29.0%)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003e60+\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e98\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e1.2\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e70 (71.4%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e28 (28.6%)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\" morerows=\"2\" rowspan=\"3\"\u003e\u003cp\u003eBody mass index (kg/m\u003csup\u003e2\u003c/sup\u003e)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003e\u0026lt;\u0026thinsp;20\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e2592\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e32\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e1644 (63.4%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e948 (36.6%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c7\" morerows=\"2\" rowspan=\"3\"\u003e\u003cp\u003e3.46E-27\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003e20\u0026ndash;30\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e2937\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e36.3\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e2249 (76.6%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e688 (23.4%)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003e30+\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e90\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e1.1\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e75 (83.3%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e15 (16.7%)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/colgroup\u003e\u003c/table\u003e\u003c/div\u003e\u003c/p\u003e\u003cp\u003eGeographic variation was also pronounced. Ukraine and Moldova exhibited the highest treatment failure proportions (38.4% and 31.5%, respectively), while Georgia (9.2%) and Belarus (15.8%) reported substantially better outcomes. Interestingly, Belarus, despite having one of the highest MDR\u0026thinsp;+\u0026thinsp;burdens (79.7%), maintained a lower failure rate than both Moldova and Ukraine. This suggests that disparities in treatment outcomes are influenced not only by drug resistance profiles, but also by systemic factors such as healthcare quality, access to care, and patient support infrastructure (\u003cb\u003eSupplementary Table\u0026nbsp;1).\u003c/b\u003e\u003c/p\u003e\u003cp\u003eThe most prominent variables collected from diagnosis were lung localisation features and severity score, resistance and comorbidities. For variables collected during/after treatment, these included \u003cem\u003eMtb\u003c/em\u003e related data, such as drug resistance (XDR: 930\u0026thinsp;\u0026minus;\u0026thinsp;11.6%; pre-XDR 373\u0026thinsp;\u0026minus;\u0026thinsp;4.6%; MDR: 3285\u0026thinsp;\u0026minus;\u0026thinsp;40.6%; poly DR: 193\u0026thinsp;\u0026minus;\u0026thinsp;2.4%; mono DR 586\u0026thinsp;\u0026minus;\u0026thinsp;7.2%; Sensitive: 2727\u0026ndash;33.7%) and lineage (L2 1475\u0026ndash;18.2%; L4 1624\u0026ndash;20.0%, other 61.8%). The prevalence of MDR and above resistance (MDR+), with Ukraine showing the highest rates of MDR-TB and above level resistance at 77.7%.\u003c/p\u003e\u003c/div\u003e\n\u003ch3\u003eSurvival analysis of treatment outcome\u003c/h3\u003e\n\u003cp\u003eTo assess the series of features influencing treatment, a survival analysis was performed using a Weibull Accelerated Failure Time (AFT) model, with time to cure as the outcome. Several drugs, including terizidone, capreomycin, kanamycin, levofloxacin, cycloserine, moxifloxacin, and linezolid, were associated with significantly longer treatment durations, suggesting their use in more complex or resistant cases. Notably, treatment failure due to additional resistance also contributed to extended treatment times.\u003c/p\u003e\u003cp\u003eFurthermore, certain \u003cem\u003eMtb\u003c/em\u003e lineages, particularly lineages 2 and 4, were linked to prolonged treatment courses, consistent with prior findings of lineage-associated treatment variability. Unexpectedly, higher education levels, increased percentage of abnormal lung volume, and use of pretomanid were associated with a shorter time to treatment completion. These counterintuitive associations may reflect confounding effects related to healthcare access, disease severity, or treatment allocation strategies. Overall, the AFT analysis complements traditional outcome prediction models by capturing the influence of clinical and microbiological variables on treatment duration (Fig.\u0026nbsp;\u003cspan refid=\"Fig1\" class=\"InternalRef\"\u003e1\u003c/span\u003e).\u003c/p\u003e\n\u003ch3\u003eModel development and feature selection\u003c/h3\u003e\n\u003cp\u003eTo predict binary clinical treatment outcomes, we developed an XGBoost model trained on a curated dataset comprising 8,094 cases and 50 features, each with less than 50% missing data. These features were grouped according to their availability at distinct clinical stages. The final input set included 8 demographic, 9 microbiological, 28 imaging (X-ray), and 5 treatment-related features (Table\u0026nbsp;\u003cspan refid=\"Tab2\" class=\"InternalRef\"\u003e2\u003c/span\u003e). This stepwise segmentation improves the model\u0026rsquo;s robustness to missing data and allows for outcome predictions at each stage of the diagnostic and treatment process. As more clinical information becomes available, the model progressively gains confidence and predictive accuracy.\u003c/p\u003e\u003cp\u003e\u003cdiv class=\"gridtable\"\u003e\u003ctable float=\"Yes\" id=\"Tab2\" border=\"1\"\u003e\u003ccaption language=\"En\"\u003e\u003cdiv class=\"CaptionNumber\"\u003eTable 2\u003c/div\u003e\u003cdiv class=\"CaptionContent\"\u003e\u003cp\u003eFeature level grouping\u003c/p\u003e\u003c/div\u003e\u003c/caption\u003e\u003ccolgroup cols=\"2\"\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c1\" colnum=\"1\"\u003e\u003c/div\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c2\" colnum=\"2\"\u003e\u003c/div\u003e\u003cthead\u003e\u003ctr\u003e\u003cth align=\"left\" colname=\"c1\"\u003e\u003cp\u003eLevels\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c2\"\u003e\u003cp\u003eVariables\u003c/p\u003e\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eDemographic (8)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eEducation, gender, employment, social risk factors, age of onset, BMI, number of daily contacts, comorbidity\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eMicrobiological (9)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eType of resistance, case definition, diagnosis code, culture, genexpert test, bactec isoniazid, bactec rifampicin, bactec ethambutol, main lineage\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eX-ray image description (25)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eOverall percent of abnormal volume, pleural effusion percent of hemithorax involved, Is pleural effusion bilateral, other non-TB abnormalities, Mediastinal lymph nodes present, Collapse, Small cavities, Medium cavities, Large cavities, Is any large cavity belong to a multi-sextant cavity, Can multiple cavities be seen, Infiltrate low ground glass density, Infiltrate medium density, Infiltrate high density, Small nodules, Medium nodules, Large nodules, Huge nodules, Is any calcified or partially calcified nodule exist, I Is any noncalcified nodule exist, Is any clustered nodule exists, Are multiple nodule exists, Low ground glass density active fresh nodules, Medium density stabilised fibrotic nodules, High density calcified typically sequella, Timika score, Lung localisation, Total cavernum\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eTreatment (5)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eregimen drug, regimen count, period span, outcome, treatment status\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/colgroup\u003e\u003ctfoot\u003e\u003ctr\u003e\u003ctd colspan=\"2\"\u003eThe detailed explanation for each feature can be found in data dictionary in TB Portal webpage: \u003cspan class=\"ExternalRef\"\u003e\u003cspan class=\"RefSource\"\u003ehttps://tbportals.niaid.nih.gov/user-guides\u003c/span\u003e\u003cspan address=\"https://tbportals.niaid.nih.gov/user-guides\" targettype=\"URL\" class=\"RefTarget\"\u003e\u003c/span\u003e\u003c/span\u003e.\u003c/td\u003e\u003c/tr\u003e\u003c/tfoot\u003e\u003c/table\u003e\u003c/div\u003e\u003c/p\u003e\n\u003ch3\u003eModel predictive performance\u003c/h3\u003e\n\u003cp\u003eThe model demonstrated strong predictive performance, achieving an accuracy of 0.91, an AUC-ROC score of 0.96, an F1 score of 0.94 and other relevant metrics such as precision and recall. These results highlight the model\u0026rsquo;s effectiveness in distinguishing between clinical outcomes in the unbalanced dataset and its potential utility in guiding decision-making processes when complete information is given\u003c/p\u003e\u003cp\u003eFollowing this, the feature importance scores from the trained model were analysed to identify the most influential predictors contributing to its performance. Key contributors included variables related to demographics (age of onset (score: 29), BMI (21)), lung pathology (Timika Score (22)), microbiological (drug resistance type (18)), and treatment (period span (65), patient stopping treatment (16)). Ranking features by their importance helped to pinpoint the most critical factors influencing the outcome, offering valuable insights into the drivers of treatment success or failure (Table\u0026nbsp;\u003cspan refid=\"Tab3\" class=\"InternalRef\"\u003e3\u003c/span\u003e, \u003cb\u003eSupplementary Table\u0026nbsp;2\u003c/b\u003e).\u003c/p\u003e\u003cp\u003e\u003cdiv class=\"gridtable\"\u003e\u003ctable float=\"Yes\" id=\"Tab3\" border=\"1\"\u003e\u003ccaption language=\"En\"\u003e\u003cdiv class=\"CaptionNumber\"\u003eTable 3\u003c/div\u003e\u003cdiv class=\"CaptionContent\"\u003e\u003cp\u003eTop importance of variables linked to treatment outcome\u003c/p\u003e\u003c/div\u003e\u003c/caption\u003e\u003ccolgroup cols=\"6\"\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c1\" colnum=\"1\"\u003e\u003c/div\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c2\" colnum=\"2\"\u003e\u003c/div\u003e\u003cdiv align=\"char\" char=\".\" class=\"colspec\" colname=\"c3\" colnum=\"3\"\u003e\u003c/div\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c4\" colnum=\"4\"\u003e\u003c/div\u003e\u003cdiv align=\"char\" char=\".\" class=\"colspec\" colname=\"c5\" colnum=\"5\"\u003e\u003c/div\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c6\" colnum=\"6\"\u003e\u003c/div\u003e\u003cthead\u003e\u003ctr\u003e\u003cth align=\"left\" colname=\"c1\"\u003e\u003cp\u003eFeature Level\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c2\"\u003e\u003cp\u003eFeature\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c3\"\u003e\u003cp\u003eImportance\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c4\"\u003e\u003cp\u003eFeature Group\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c5\"\u003e\u003cp\u003eMissing values\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c6\"\u003e\u003cp\u003eHighest Correlated Feature (Correlation Value)\u003c/p\u003e\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\" morerows=\"5\" rowspan=\"6\"\u003e\u003cp\u003eDemographic\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eAge of onset\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e29\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003eAge of onset\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e0 (0.0%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c6\"\u003e\u003cp\u003eOthers (0.17)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eBMI\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e21\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003eBMI\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e2475 (30.6%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c6\"\u003e\u003cp\u003eDiabetes (0.15)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eNo. daily contacts\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e13\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003eNo. daily contacts\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e2887 (35.7%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c6\"\u003e\u003cp\u003eCapreomycin (0.17)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eEducation\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e12\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003eEducation\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e0 (0.0%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c6\"\u003e\u003cp\u003eGeneXpert test (0.32)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eEmployment\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e8\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003eEmployment\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e369 (4.6%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c6\"\u003e\u003cp\u003eEducation (0.28)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eMDR contact\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e7\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003eSocial risk factors\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e0 (0.0%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c6\"\u003e\u003cp\u003eNo. daily contacts (0.11)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\" morerows=\"2\" rowspan=\"3\"\u003e\u003cp\u003eMicrobiological\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eResistance type\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e18\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003eType of resistance\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e0 (0.0%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c6\"\u003e\u003cp\u003eGeneXpert test (0.7)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eCase definition\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e12\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003eCase definition\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e0 (0.0%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c6\"\u003e\u003cp\u003eIsoniazid (0.29)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eCulture negative\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e9\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003eCulture\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e0 (0.0%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c6\"\u003e\u003cp\u003eClofazimine (0.36)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\" morerows=\"2\" rowspan=\"3\"\u003e\u003cp\u003eX-ray\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eTimika score\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e22\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003eTimika score\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e1898 (23.4%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c6\"\u003e\u003cp\u003eAbnormal vol. % (0.69)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eCalcified nodule\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e8\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003eCalcified nodule\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e0 (0.0%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c6\"\u003e\u003cp\u003eHigh density calcified (0.62)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eInfiltrate low ground glass density\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e7\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003eInfiltrate low ground glass density\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e0 (0.0%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c6\"\u003e\u003cp\u003eInfiltrate medium density (0.5)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\" morerows=\"5\" rowspan=\"6\"\u003e\u003cp\u003eTreatment\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003ePeriod span\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e65\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003ePeriod span\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e104 (1.3%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c6\"\u003e\u003cp\u003eCapreomycin (0.35)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003ePatient stopped treatment\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e16\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003eTreatment tatus\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e0 (0.0%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c6\"\u003e\u003cp\u003eInfiltrate high density (0.15)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003ePretomanid\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e11\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003eDrug regimen\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e0 (0.0%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c6\"\u003e\u003cp\u003eBedaquiline (0.11)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eAmoxicillin-clavulanate\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e8\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003eDrug regimen\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e0 (0.0%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c6\"\u003e\u003cp\u003eImipenem-cilastatin (0.86)\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eTreatment ended\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e7\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003eTreatment status\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e0 (0.0%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c6\"\u003e\u003cp\u003eNot reported-Comorbidity (0.31\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003eAdverse event\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e6\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003eTreatment status\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c5\"\u003e\u003cp\u003e0 (0.0%)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c6\"\u003e\u003cp\u003eImipenem-cilastatin (0.17\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/colgroup\u003e\u003ctfoot\u003e\u003ctr\u003e\u003ctd colspan=\"6\"\u003eThe detailed explanation for each feature can be found in data dictionary in TB portals webpage: \u003cspan class=\"ExternalRef\"\u003e\u003cspan class=\"RefSource\"\u003ehttps://tbportals.niaid.nih.gov/user-guides\u003c/span\u003e\u003cspan address=\"https://tbportals.niaid.nih.gov/user-guides\" targettype=\"URL\" class=\"RefTarget\"\u003e\u003c/span\u003e\u003c/span\u003e. Full table can be found in \u003cb\u003eSupplementary table \u003cspan refid=\"MOESM1\" class=\"InternalRef\"\u003e1\u003c/span\u003e\u003c/b\u003e.\u003c/td\u003e\u003c/tr\u003e\u003c/tfoot\u003e\u003c/table\u003e\u003c/div\u003e\u003c/p\u003e\n\u003ch3\u003eFeature importance and odds ratios\u003c/h3\u003e\n\u003cp\u003eTo provide epidemiological interpretability and clinical relevance in explanatory modelling, multivariate odds ratios were calculated for features included in the treatment outcome prediction model. While XGBoost's feature importance highlights variables contributing to predictive performance, odds ratios (ORs) offer direct, interpretable estimates of the strength and direction of association between individual features and treatment success. Prior to analysis, collinearity among features was assessed to ensure exclusion of highly correlated features, resulting in a refined set of predictors. Adjusted Odds ratios (AORs) with 95% confidence intervals were computed using logistic regression for continuous and multicategory features, and Fisher\u0026rsquo;s exact test for binary features.\u003c/p\u003e\u003cp\u003eThe OR analysis revealed several features with strong, statistically significant associations with treatment outcome. For instance, \"Treatment ended\" (AOR\u0026thinsp;=\u0026thinsp;11.11, 95% CI: 7.59\u0026ndash;16.27) and \u0026ldquo;pretomanid\u0026rdquo; (AOR\u0026thinsp;=\u0026thinsp;5.57, 95% CI: 2.58\u0026ndash;12.02) were associated with markedly increased chances of treatment success, aligning with their high XGBoost importance scores. Similarly, features such as \u0026ldquo;Culture result - negative\u0026rdquo; (AOR\u0026thinsp;=\u0026thinsp;4.31, 95% CI: 3.47\u0026ndash;5.35), \u0026ldquo;Continuation of treatment\u0026rdquo; (AOR\u0026thinsp;=\u0026thinsp;1.66, 95% CI: 1.2\u0026ndash;2.29), and \u0026ldquo;Clofazimine\u0026rdquo; (AOR\u0026thinsp;=\u0026thinsp;1.94, 95% CI: 1.4\u0026ndash;2.7) showed positive associations with favourable outcomes. Conversely, variables such as \u0026ldquo;Patient stopped treatment\u0026rdquo; (AOR\u0026thinsp;=\u0026thinsp;0.11, 95% CI: 0.06\u0026ndash;0.22), \u0026ldquo;Treatment ineffective due to additional resistance\u0026rdquo; (AOR\u0026thinsp;=\u0026thinsp;0.29, 95% CI: 0.18\u0026ndash;0.45), and \u0026ldquo;Adverse event\u0026rdquo; (AOR\u0026thinsp;=\u0026thinsp;0.33, 95% CI: 0.18\u0026ndash;0.61) were associated with significantly increased risks of failure. Interestingly, although variables like \u0026ldquo;age of onset\u0026rdquo; (AOR\u0026thinsp;=\u0026thinsp;0.98, 95% CI: 0.97\u0026ndash;0.99) and \u0026ldquo;BMI\u0026rdquo; (AOR\u0026thinsp;=\u0026thinsp;1.04, 95% CI: 1.01\u0026ndash;1.07) had modest effect sizes, they were still statistically significant, reinforcing their clinical importance despite subtle individual contributions. These findings illustrate how OR analysis complements ML feature importance by offering interpretable estimates of individual feature effects, while models like XGBoost capture nonlinearities and interactions, providing a more holistic understanding of the determinants of treatment outcome (\u003cb\u003eSupplementary Table\u0026nbsp;3\u003c/b\u003e).\u003c/p\u003e\u003cdiv id=\"Sec8\" class=\"Section2\"\u003e\u003ch2\u003eStepwise modelling results\u003c/h2\u003e\u003cp\u003eStepwise accuracy analysis examines how the inclusion of features from distinct stages of the diagnostic and treatment process impacts model performance. Hierarchical model features are grouped into four levels based on when they become available: demographic pre-treatment (demographics and socioeconomic information), microbiological (drug resistance and health status), X-ray (imaging-based features like lung localisation and severity scores), and Treatment (treatment and regimen details). By progressively adding features from these levels, the analysis evaluates the model's ability to predict outcomes at each stage, highlighting the value of early information while demonstrating how prediction confidence improves as additional data is incorporated (Models 1 to 4). Model 1 uses only pre-treatment features (demographics and socioeconomic data). Model 2 adds microbiological features (drug resistance and health levels), improving sensitivity and accuracy. Model 3 includes imaging-based features (lung localisation and severity scores), further enhancing performance. Model 4 incorporates all feature levels, including Treatment data (regimen and adherence), achieving the highest metrics. This stepwise progression highlights how additional diagnostic and treatment data improve predictive accuracy.\u003c/p\u003e\u003cp\u003eThe stepwise accuracy analysis reveals the progressive improvement in model performance as features from successive diagnostic and treatment stages are incorporated (Table\u0026nbsp;\u003cspan refid=\"Tab4\" class=\"InternalRef\"\u003e4\u003c/span\u003e). Model 1, using only pre-treatment features such as demographics and socioeconomic information, achieved a baseline testing accuracy of 0.7165, sensitivity of 0.7115, and AUC-ROC of 0.8048. These metrics reflect the predictive power of basic patient-level data but indicate limitations in capturing more complex clinical dynamics (Table\u0026nbsp;\u003cspan refid=\"Tab4\" class=\"InternalRef\"\u003e4\u003c/span\u003e). Adding microbiological features, including drug resistance profiles and patient health levels, in Model 2 greatly improved sensitivity to 0.8270 and testing accuracy to 0.7925, highlighting the importance of diagnostic information for outcome prediction. Model 3, which incorporates imaging-based features such as lung localisation and severity scores, provided marginal improvements over Model 2, with testing accuracy increasing to 0.8017 and AUC-ROC to 0.8575. This suggests that imaging data adds value but is most impactful when combined with earlier feature levels. Model 4, incorporating all feature levels (except for the image-based feature), achieved the high performance, with a testing accuracy of 0.9067, sensitivity of 0.9212, and an AUC-ROC of 0.9535. These metrics reflect the cumulative benefit of integrating comprehensive patient data, enabling the model to capture complex interactions and improve confidence in predictions.\u003c/p\u003e\u003cp\u003e\u003cdiv class=\"gridtable\"\u003e\u003ctable float=\"Yes\" id=\"Tab4\" border=\"1\"\u003e\u003ccaption language=\"En\"\u003e\u003cdiv class=\"CaptionNumber\"\u003eTable 4\u003c/div\u003e\u003cdiv class=\"CaptionContent\"\u003e\u003cp\u003ePredictive accuracy across the different models*\u003c/p\u003e\u003c/div\u003e\u003c/caption\u003e\u003ccolgroup cols=\"6\"\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c1\" colnum=\"1\"\u003e\u003c/div\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c2\" colnum=\"2\"\u003e\u003c/div\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c3\" colnum=\"3\"\u003e\u003c/div\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c4\" colnum=\"4\"\u003e\u003c/div\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c5\" colnum=\"5\"\u003e\u003c/div\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c6\" colnum=\"6\"\u003e\u003c/div\u003e\u003cthead\u003e\u003ctr\u003e\u003cth align=\"left\" colname=\"c1\"\u003e\u003cp\u003eMetric\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c2\"\u003e\u003cp\u003eModel 1\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c3\"\u003e\u003cp\u003eModel 2\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c4\"\u003e\u003cp\u003eModel 3\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c5\"\u003e\u003cp\u003eModel 4\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c6\"\u003e\u003cp\u003eAll features\u003c/p\u003e\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eNumber of features\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003e8\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003e17\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e45\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c5\"\u003e\u003cp\u003e23\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c6\"\u003e\u003cp\u003e50\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eTesting Accuracy\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003e0.7365\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003e0.7925\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e0.8017\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c5\"\u003e\u003cp\u003e0.9067\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c6\"\u003e\u003cp\u003e0.9111\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eSensitivity (Recall)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003e0.7377\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003e0.8270\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e0.8320\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c5\"\u003e\u003cp\u003e0.9212\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c6\"\u003e\u003cp\u003e0.9262\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eSpecificity\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003e0.7293\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003e0.6867\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e0.7093\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c5\"\u003e\u003cp\u003e0.8622\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c6\"\u003e\u003cp\u003e0.8647\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eAUC-ROC\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003e0.8027\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003e0.8477\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e0.8575\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c5\"\u003e\u003cp\u003e0.9535\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c6\"\u003e\u003cp\u003e0.9555\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eF1-Score\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c2\"\u003e\u003cp\u003e0.8079\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c3\"\u003e\u003cp\u003e0.8573\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c4\"\u003e\u003cp\u003e0.8635\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c5\"\u003e\u003cp\u003e0.9371\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c6\"\u003e\u003cp\u003e0.9401\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/colgroup\u003e\u003ctfoot\u003e\u003ctr\u003e\u003ctd colspan=\"6\"\u003eModel 1 uses only demographic features (demographics and socioeconomic data). Model 2 adds microbiological features (drug resistance and health levels), improving sensitivity and accuracy. Model 3 adds in X-ray based features (lung localisation and severity scores), further enhancing performance. Model 4 incorporates demographic, microbiological and treatment feature levels, including Treatment data (regimen and adherence). This stepwise progression highlights how additional diagnostic and treatment data improve predictive accuracy.\u003c/td\u003e\u003c/tr\u003e\u003c/tfoot\u003e\u003c/table\u003e\u003c/div\u003e\u003c/p\u003e\u003cp\u003eInterestingly, including all features together without consideration of feature levels yielded slightly lower performance metrics (e.g., testing accuracy of 0.9111 and sensitivity of 0.9262), underscoring the importance of structured feature inclusion and the potential impact of noise or redundancy in the data. However, image data does show limited ineffectiveness in slightly increasing predictive power. This analysis demonstrates the model\u0026rsquo;s prediction power at each stage of the clinical admission process, aligning with clinical workflows where data becomes available progressively. Looking at the correlation between features (Fig.\u0026nbsp;\u003cspan refid=\"Fig2\" class=\"InternalRef\"\u003e2\u003c/span\u003e), there is very low correlation between X-ray features and all other features. High correlation exists within X-ray features, but collectively, they do not contribute as much as other variables to the power of the model.\u003c/p\u003e\u003c/div\u003e\n\u003ch3\u003eBenchmarking with alternative ML models\u003c/h3\u003e\n\u003cp\u003eTo evaluate the performance of different machine learning approaches using the complete feature set, we compared XGBoost (XGB) with logistic regression, naive Bayes, Support Vector Machines (SVMs), k-Nearest Neighbours (k-NN), and Multi-Layer Perceptron (MLP). Among these models, XGB consistently outperformed others in terms of accuracy, sensitivity, specificity, and AUC-ROC, demonstrating its ability to handle high-dimensional data and capture complex non-linear interactions. SVM and MLP, which inherently model feature interactions, performed comparably to XGB in certain metrics but did not deal with the data imbalance as well. Logistic regression and k-NN, while simpler and interpretable, could not model feature interactions effectively, leading to lower predictive performance. Naive Bayes, with its assumption of feature independence, showed the weakest performance, highlighting its limitations in handling complex clinical datasets. The results underscore the strength of XGB as a robust, flexible model for predicting treatment outcomes while also showcasing the relative strengths and weaknesses of alternative approaches (Table\u0026nbsp;\u003cspan refid=\"Tab5\" class=\"InternalRef\"\u003e5\u003c/span\u003e).\u003c/p\u003e\u003cp\u003e\u003cdiv class=\"gridtable\"\u003e\u003ctable float=\"Yes\" id=\"Tab5\" border=\"1\"\u003e\u003ccaption language=\"En\"\u003e\u003cdiv class=\"CaptionNumber\"\u003eTable 5\u003c/div\u003e\u003cdiv class=\"CaptionContent\"\u003e\u003cp\u003e\u003cb\u003eComparison of the predictive ability of the XGBoost model and other machine learning approaches\u003c/b\u003e\u003c/p\u003e\u003c/div\u003e\u003c/caption\u003e\u003ccolgroup cols=\"7\"\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c1\" colnum=\"1\"\u003e\u003c/div\u003e\u003cdiv align=\"char\" char=\".\" class=\"colspec\" colname=\"c2\" colnum=\"2\"\u003e\u003c/div\u003e\u003cdiv align=\"char\" char=\".\" class=\"colspec\" colname=\"c3\" colnum=\"3\"\u003e\u003c/div\u003e\u003cdiv align=\"char\" char=\".\" class=\"colspec\" colname=\"c4\" colnum=\"4\"\u003e\u003c/div\u003e\u003cdiv align=\"left\" class=\"colspec\" colname=\"c5\" colnum=\"5\"\u003e\u003c/div\u003e\u003cdiv align=\"char\" char=\".\" class=\"colspec\" colname=\"c6\" colnum=\"6\"\u003e\u003c/div\u003e\u003cdiv align=\"char\" char=\".\" class=\"colspec\" colname=\"c7\" colnum=\"7\"\u003e\u003c/div\u003e\u003cthead\u003e\u003ctr\u003e\u003cth align=\"left\" colname=\"c1\"\u003e\u003cp\u003eMetric\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c2\"\u003e\u003cp\u003eLogistic Regression\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c3\"\u003e\u003cp\u003eNaive Bayes\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c4\"\u003e\u003cp\u003eSVM\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c5\"\u003e\u003cp\u003ek-NN\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c6\"\u003e\u003cp\u003eMLP\u003c/p\u003e\u003c/th\u003e\u003cth align=\"left\" colname=\"c7\"\u003e\u003cp\u003eXGBoost\u003c/p\u003e\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eTesting Accuracy\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c2\"\u003e\u003cp\u003e0.8573\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e0.7739\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c4\"\u003e\u003cp\u003e0.8481\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c5\"\u003e\u003cp\u003e0.7690\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e0.8678\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c7\"\u003e\u003cp\u003e0.9074\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eSensitivity (Recall)\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c2\"\u003e\u003cp\u003e0.8762\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e0.8336\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c4\"\u003e\u003cp\u003e0.9025\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c5\"\u003e\u003cp\u003e0.8066\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e0.9082\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c7\"\u003e\u003cp\u003e0.9189\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eSpecificity\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c2\"\u003e\u003cp\u003e0.7995\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e0.5915\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c4\"\u003e\u003cp\u003e0.6817\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c5\"\u003e\u003cp\u003e0.6541\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e0.7444\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c7\"\u003e\u003cp\u003e0.8722\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eAUC-ROC\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c2\"\u003e\u003cp\u003e0.9075\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e0.7931\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c4\"\u003e\u003cp\u003e0.8592\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c5\"\u003e\u003cp\u003eN/A\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e0.8879\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c7\"\u003e\u003cp\u003e0.9555\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd align=\"left\" colname=\"c1\"\u003e\u003cp\u003eF1-Score\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c2\"\u003e\u003cp\u003e0.9025\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c3\"\u003e\u003cp\u003e0.8475\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c4\"\u003e\u003cp\u003e0.8995\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"left\" colname=\"c5\"\u003e\u003cp\u003e0.8403\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c6\"\u003e\u003cp\u003e0.9119\u003c/p\u003e\u003c/td\u003e\u003ctd align=\"char\" char=\".\" colname=\"c7\"\u003e\u003cp\u003e0.9373\u003c/p\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/colgroup\u003e\u003ctfoot\u003e\u003ctr\u003e\u003ctd colspan=\"7\"\u003eSVM: Support vector machine; MLP: Multilayer perceptron; k-NN: k nearest neighbour; XGBoost: Extreme gradient boosting\u003c/td\u003e\u003c/tr\u003e\u003c/tfoot\u003e\u003c/table\u003e\u003c/div\u003e\u003c/p\u003e"},{"header":"Discussion","content":"\u003cp\u003eThe stepwise approach employed in this study closely mirrors the clinical timeline, making it particularly relevant and relatable for healthcare providers. Early-stage features, such as demographics and socioeconomic information, are essential for initial risk stratification, enabling clinicians to identify patients who may require closer monitoring or additional resources. For instance, using only early-stage features, the model achieved an accuracy of 71.65%, demonstrating the utility of even limited data for risk stratification. Microbiological data, including drug resistance profiles and patient health metrics, further enhance the model's specificity in identifying high-risk cases, providing valuable insights for tailoring treatment strategies. Incorporating these features improved the model\u0026rsquo;s accuracy to 80.42%, highlighting the significant value of diagnostic data. As more data becomes available, such as imaging results and treatment details, predictions are refined and confidence in outcomes increases. This progression is evidenced by the model's performance, which peaked at an accuracy of 90.86% when all feature levels were included. This progressive integration of data aligns with real-world clinical workflows, supporting decision-making at every stage of the diagnostic and treatment process.\u003c/p\u003e\u003cp\u003eWhile the stepwise approach demonstrates the model\u0026rsquo;s ability to improve prediction as more data becomes available, certain late-stage features warrant careful interpretation. Period span, which captures how long a patient has already been on treatment, can significantly boost model performance but may primarily reflect retrospective information. In clinical practice, a prolonged treatment duration often signals a complex or failing case, which may already be evident to healthcare providers without the aid of a predictive model. However, period span is also a temporally evolving feature. As part of a longitudinal decision-support framework, it can be progressively incorporated into the model, allowing predictions to adapt over time. This dynamic integration supports the model\u0026rsquo;s role not only at the point of diagnosis but also throughout the treatment course, offering updated risk estimates as new clinical data becomes available.\u003c/p\u003e\u003cp\u003eMachine learning (ML) has been increasingly applied to predictive modelling in healthcare, demonstrating its utility in outcome prediction, risk stratification, and clinical decision support. XGBoost, in particular, has shown significant advantages when applied to structured, tabular datasets like those used in this study. Compared to other ML methods, XGBoost excels in handling high-dimensional data, capturing non-linear feature interactions, and maintaining strong performance even with imbalanced datasets\u003csup\u003e\u003cspan citationid=\"CR9\" class=\"CitationRef\"\u003e9\u003c/span\u003e\u003c/sup\u003e. XGBoost outperformed other models such as logistic regression and naive Bayes, achieving a testing accuracy of 90.74% compared to 85.73% and 77.39%, respectively. One of its key strengths is its ability to manage missing data effectively, a common challenge in healthcare datasets. Studies have highlighted XGBoost\u0026rsquo;s ability to impute missing values during the training process, which makes it especially suited for stepwise approaches that deal with progressively available clinical data and low-resource setting. Additionally, feature importance analysis within XGBoost provides interpretable insights, allowing clinicians to understand which variables drive predictions and how these relate to clinical outcomes. Such interpretability is critical for aligning ML outputs with clinical reasoning and improving trust in predictive models. The feature importance assessment revealed known factors that affect clinical treatment outcomes, including treatment duration, age of onset, frequency of receiving anti-TB medication and BMI.\u003c/p\u003e\u003cp\u003eOverall, this study highlights the value of stepwise machine learning models in mirroring clinical workflows and supporting outcome prediction at multiple stages of TB management. By integrating progressively available data, such models can enhance early risk stratification and adapt dynamically throughout treatment, offering a practical tool for personalised, data-driven care.\u003c/p\u003e"},{"header":"Methods","content":"\u003cdiv id=\"Sec11\" class=\"Section2\"\u003e\u003cp\u003eTB Portal dataset\u003c/p\u003e\u003cp\u003e The dataset for this study was obtained from the TB Portal database, a global open-access resource containing comprehensive clinical, radiological, genomic, and demographic data on TB patients. The detailed explanation for each feature can be found in the data dictionary for the database (\u003cspan class=\"ExternalRef\"\u003e\u003cspan class=\"RefSource\"\u003ehttps://tbportals.niaid.nih.gov/user-guides\u003c/span\u003e\u003cspan address=\"https://tbportals.niaid.nih.gov/user-guides\" targettype=\"URL\" class=\"RefTarget\"\u003e\u003c/span\u003e\u003c/span\u003e). Features with more than 50% of missing values were dropped. The country feature was also dropped to improve the generalisability of the model. After cleaning, 8094 data points with 51 features remain. Out of the features, 17 features with clear hierarchical relationships in the data were transformed using ordinal encoding (\u003cb\u003eSupplementary Table\u0026nbsp;4\u003c/b\u003e), and 7 features contain comma-separated categorical terms. After one-hot encoding of the terms, 166 features were used to train the model (\u003cb\u003eSupplementary Table\u0026nbsp;5\u003c/b\u003e). Features were categorised into four levels based on their availability at different stages of the diagnostic and treatment process: pre-treatment (demographics and socioeconomic data), microbiological (drug resistance and health status), X-ray (imaging-based features such as lung localisation and severity scores), and treatment (regimen and adherence details). Preprocessing steps included handling missing data using a most frequent value imputation strategy with the Simple Imputer. Features with near-zero variance were removed using a variance threshold filter with a threshold of 0.01. Collinearity was assessed to ensure robust model interpretability, with highly correlated features excluded from specific analyses.\u003c/p\u003e\u003c/div\u003e\u003cdiv id=\"Sec12\" class=\"Section2\"\u003e\u003ch2\u003eTime to outcome analyses\u003c/h2\u003e\u003cp\u003eTo assess factors associated with treatment duration, we applied an Accelerated Failure Time (AFT) model using a Weibull distribution. The analysis focused on time to cure, which was selected as the event of interest due to its higher representation in the dataset compared to failure or death. Patients with negative outcomes were treated as censored observations. Predictor variables included clinical, demographic, and treatment-related features, with continuous variables standardised and categorical variables encoded as ordinal or binary depending on their clinical context. Model coefficients were interpreted as time ratios, indicating whether a given feature was associated with a longer or shorter time to cure. Statistical significance was determined using p-values (threshold: p\u0026thinsp;\u0026lt;\u0026thinsp;0.05). The analysis was performed using the lifelines package in Python.\u003c/p\u003e\u003c/div\u003e\u003cdiv id=\"Sec13\" class=\"Section2\"\u003e\u003ch2\u003eModel Development and Evaluation\u003c/h2\u003e\u003cp\u003eAn XGBoost (Extreme Gradient Boosting) model was developed to predict binary treatment outcomes, leveraging its ability to handle high-dimensional data, capture non-linear feature interactions, and manage missing values. The data was split into training and testing sets using an 80\u0026thinsp;\u0026minus;\u0026thinsp;20 stratified split, and RandomOverSampler was applied to the training data to address class imbalance. The importance of each feature in the XGBoost model was determined using weight-based feature importance, which reflects the frequency of a feature being used in tree splits. Feature importance rankings were used to identify key predictors influencing treatment outcomes. A stepwise approach was used to assess the incremental impact of feature levels on predictive performance. Features were grouped by their availability during the diagnostic and treatment process (pre-treatment, microbiological, X-ray, and Treatment) and systematically added to the model. The evolution of performance metrics, such as accuracy, sensitivity, specificity, and AUC-ROC, was tracked to evaluate the contribution of each feature level. An advantage of the approach is that the resulting trees were visually inspected and interpreted. For example, see \u003cb\u003eSupplementary Fig.\u0026nbsp;1\u003c/b\u003e, which shows a tree that splits first on \u0026ldquo;treatment ended\u0026rdquo;, followed by other key features, including regimen count, education, and pretomanid, indicating their importance in early classification. The structure also reveals how missing values are handled and how variables such as Patient drug abuse, age of onset, and employment contribute directionally to the outcome.\u003c/p\u003e\u003c/div\u003e\u003cdiv id=\"Sec14\" class=\"Section2\"\u003e\u003ch2\u003eOdds ratio analysis\u003c/h2\u003e\u003cp\u003eTo provide clinically interpretable insights, we performed an odds ratio analysis on all features present in the modelling dataset. Binary features were assessed using Fisher\u0026rsquo;s exact test to compute crude odds ratios and corresponding p-values. For continuous and multi-categorical features, logistic regression models were fitted with the outcome as the dependent variable, and adjusted odds ratios (AORs) were obtained by exponentiating the model coefficients. Confidence intervals (95%) were derived from the logistic model estimates. This approach allowed consistent inclusion of both binary and non-binary variables without requiring binarization. A variance inflation factor (VIF) analysis was conducted prior to modelling to eliminate highly collinear features, and only complete cases (rows without missing values) were used.\u003c/p\u003e\u003c/div\u003e"},{"header":"Abbreviations","content":"\u003cdiv class=\"DefinitionList\"\u003e\u003cdiv class=\"DefinitionListEntry\"\u003e\u003cdiv class=\"Description\"\u003e\u003cp\u003e\u003cb\u003eFull Term\u003c/b\u003e\u003c/p\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv class=\"DefinitionListEntry\"\u003e\u003cdiv class=\"Term\"\u003eTB\u003c/div\u003e\u003cdiv class=\"Description\"\u003e\u003cp\u003eTuberculosis\u003c/p\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv class=\"DefinitionListEntry\"\u003e\u003cdiv class=\"Term\"\u003eMtb\u003c/div\u003e\u003cdiv class=\"Description\"\u003e\u003cp\u003e\u003cem\u003eMycobacterium tuberculosis\u003c/em\u003e\u003c/p\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv class=\"DefinitionListEntry\"\u003e\u003cdiv class=\"Term\"\u003eRR-TB\u003c/div\u003e\u003cdiv class=\"Description\"\u003e\u003cp\u003eRifampicin-resistant tuberculosis\u003c/p\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv class=\"DefinitionListEntry\"\u003e\u003cdiv class=\"Term\"\u003eMDR-TB\u003c/div\u003e\u003cdiv class=\"Description\"\u003e\u003cp\u003eMultidrug-resistant tuberculosis\u003c/p\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv class=\"DefinitionListEntry\"\u003e\u003cdiv class=\"Term\"\u003eXDR-TB\u003c/div\u003e\u003cdiv class=\"Description\"\u003e\u003cp\u003eExtensively drug-resistant tuberculosis\u003c/p\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv class=\"DefinitionListEntry\"\u003e\u003cdiv class=\"Term\"\u003eCT\u003c/div\u003e\u003cdiv class=\"Description\"\u003e\u003cp\u003eComputed tomography\u003c/p\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv class=\"DefinitionListEntry\"\u003e\u003cdiv class=\"Term\"\u003eML\u003c/div\u003e\u003cdiv class=\"Description\"\u003e\u003cp\u003eMachine learning\u003c/p\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv class=\"DefinitionListEntry\"\u003e\u003cdiv class=\"Term\"\u003eXGB\u003c/div\u003e\u003cdiv class=\"Description\"\u003e\u003cp\u003eXGBoost (Extreme Gradient Boosting)\u003c/p\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv class=\"DefinitionListEntry\"\u003e\u003cdiv class=\"Term\"\u003eSVM\u003c/div\u003e\u003cdiv class=\"Description\"\u003e\u003cp\u003eSupport Vector Machine\u003c/p\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv class=\"DefinitionListEntry\"\u003e\u003cdiv class=\"Term\"\u003ek-NN\u003c/div\u003e\u003cdiv class=\"Description\"\u003e\u003cp\u003ek-Nearest Neighbour\u003c/p\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv class=\"DefinitionListEntry\"\u003e\u003cdiv class=\"Term\"\u003eMLP\u003c/div\u003e\u003cdiv class=\"Description\"\u003e\u003cp\u003eMulti-Layer Perceptron\u003c/p\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv class=\"DefinitionListEntry\"\u003e\u003cdiv class=\"Term\"\u003eAUC-ROC\u003c/div\u003e\u003cdiv class=\"Description\"\u003e\u003cp\u003eArea under the receiver operating characteristic curve\u003c/p\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv class=\"DefinitionListEntry\"\u003e\u003cdiv class=\"Term\"\u003eF1-score\u003c/div\u003e\u003cdiv class=\"Description\"\u003e\u003cp\u003eF1 harmonic mean of precision and recall\u003c/p\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv class=\"DefinitionListEntry\"\u003e\u003cdiv class=\"Term\"\u003eOR\u003c/div\u003e\u003cdiv class=\"Description\"\u003e\u003cp\u003eOdds ratio\u003c/p\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv class=\"DefinitionListEntry\"\u003e\u003cdiv class=\"Term\"\u003eAOR\u003c/div\u003e\u003cdiv class=\"Description\"\u003e\u003cp\u003eAdjusted odds ratio\u003c/p\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv class=\"DefinitionListEntry\"\u003e\u003cdiv class=\"Term\"\u003eCI\u003c/div\u003e\u003cdiv class=\"Description\"\u003e\u003cp\u003eConfidence interval\u003c/p\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv class=\"DefinitionListEntry\"\u003e\u003cdiv class=\"Term\"\u003eBMI\u003c/div\u003e\u003cdiv class=\"Description\"\u003e\u003cp\u003eBody mass index\u003c/p\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv class=\"DefinitionListEntry\"\u003e\u003cdiv class=\"Term\"\u003eIQR\u003c/div\u003e\u003cdiv class=\"Description\"\u003e\u003cp\u003eInterquartile range\u003c/p\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv class=\"DefinitionListEntry\"\u003e\u003cdiv class=\"Term\"\u003eSD\u003c/div\u003e\u003cdiv class=\"Description\"\u003e\u003cp\u003eStandard deviation\u003c/p\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv class=\"DefinitionListEntry\"\u003e\u003cdiv class=\"Term\"\u003eAFT\u003c/div\u003e\u003cdiv class=\"Description\"\u003e\u003cp\u003eAccelerated Failure Time\u003c/p\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv class=\"DefinitionListEntry\"\u003e\u003cdiv class=\"Term\"\u003eVIF\u003c/div\u003e\u003cdiv class=\"Description\"\u003e\u003cp\u003eVariance Inflation Factor\u003c/p\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv class=\"DefinitionListEntry\"\u003e\u003cdiv class=\"Term\"\u003eWHO\u003c/div\u003e\u003cdiv class=\"Description\"\u003e\u003cp\u003eWorld Health Organization\u003c/p\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e"},{"header":"Declarations","content":"\u003cp\u003e\u003cstrong\u003eEthics approval and consent to participate\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eThis study did not involve the collection of new human or animal data. All analyses were conducted on de-identified, publicly available data from the TB Portals program (https://tbportals.niaid.nih.gov), an open-access resource supported by the U.S. National Institute of Allergy and Infectious Diseases. The TB Portals dataset is curated in accordance with ethical standards, including removal of personal identifiers, and is made available for research under the program\u0026rsquo;s data-sharing policies. As no direct patient contact or intervention was performed by the authors, additional institutional ethical approval was not required. This study was conducted in accordance with the ethical principles set out in the Declaration of Helsinki.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eConsent to Participate\u0026nbsp;\u003c/strong\u003e\u003cstrong\u003edeclaration\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eNot applicable.\u003c/p\u003e\n\u003ch2\u003eConsent for publication\u003c/h2\u003e\n\u003cp\u003eAll authors have read and approved the final manuscript. They consent to the publication of this work and confirm that the content is original and has not been published or submitted for publication elsewhere.\u003c/p\u003e\n\u003ch2\u003eCompeting interests\u003c/h2\u003e\n\u003cp\u003eNo potential conflict of interest was reported by the authors.\u003c/p\u003e\n\u003ch2\u003eFunding\u003c/h2\u003e\n\u003cp\u003eLW is funded by a BBSRC LIDO studentship (Ref. BB/T008709/1). TGC and SC are funded by the UKRI (BBSRC BB/X018156/1; MRC MR/R020973/1, MRC MR/X005895/1; EPSRC EP/Y018842/1)). The funders had no role in the study design, data collection and analysis, the decision to publish, or the preparation of the manuscript. The authors declare that they have no conflicts of interest.\u003c/p\u003e\n\u003ch2\u003eAuthor Contribution\u003c/h2\u003e\n\u003cp\u003eLW and JEP conceived and directed the project. LW developed the models under the supervision of SC, TGC and JEP. LW wrote the first draft of the manuscript. All authors commented on and edited various versions of the draft manuscript and approved the final manuscript. LW, TGC and JEP compiled the final manuscript.\u003c/p\u003e\n\u003ch2\u003eData Availability\u003c/h2\u003e\n\u003cp\u003eNot data collection was done. All data used is from online database TB portal. All data is available upon request from TB portal: https://tbportals.niaid.nih.gov/ The code and model can be found in the author\u0026rsquo;s Github: https://github.com/linfeng-wang/TBpt\u003c/p\u003e"},{"header":"References","content":"\u003col\u003e\u003cli\u003e\u003cspan\u003eGlobal Tuberculosis Report. 2023. \u003cspan class=\"ExternalRef\"\u003e\u003cspan class=\"RefSource\"\u003ehttps://www.who.int/teams/global-tuberculosis-programme/tb-reports/global-tuberculosis-report-2023\u003c/span\u003e\u003cspan address=\"https://www.who.int/teams/global-tuberculosis-programme/tb-reports/global-tuberculosis-report-2023\" targettype=\"URL\" class=\"RefTarget\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eWHO. Who Revised Definitions and Reporting Framework for Tuberculosis. Eurosurveillance vol. 18. (2013).\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eSalindri AD, et al. HIV co-infection increases the risk of post-tuberculosis mortality among persons who initiated treatment for drug-resistant tuberculosis. Sci Rep. 2024;14:23834.\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eBoadu AA, Yeboah-Manu M, Osei-Wusu S, Yeboah-Manu D. Tuberculosis and diabetes mellitus: The complexity of the comorbid interactions. Int J Infect Dis. 2024;146:107140.\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eWang EY, Arrazola RA, Mathema B, Ahluwalia IB, Mase SR. The impact of smoking on tuberculosis treatment outcomes: a meta-analysis. Int J Tuberc Lung Dis. 2020;24:170\u0026ndash;5.\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eJin S, et al. A Predictive Model for the 10-year Overall Survival Status of Patients With Distant Metastases From Differentiated Thyroid Cancer Using XGBoost Algorithm-A Population-Based Analysis. Front Genet. 2022;13:896805.\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eAbd Al Rahman E, Ruhaiyem NIR, Bouchahma M. A multioutput classifier model for breast cancer treatment prediction. Intelligence-Based Med. 2024;10:100158.\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eThe TB. Portals: an Open-Access, Web-Based Platform for Global Drug-Resistant-Tuberculosis Data Sharing and Analysis | Journal of Clinical Microbiology. \u003cspan class=\"ExternalRef\"\u003e\u003cspan class=\"RefSource\"\u003ehttps://journals.asm.org/doi/\u003c/span\u003e\u003cspan address=\"https://journals.asm.org/doi/\" targettype=\"URL\" class=\"RefTarget\"\u003e\u003c/span\u003e\u003c/span\u003e\u003cspan class=\"ExternalRef\"\u003e\u003cspan class=\"RefSource\"\u003e10.1128/jcm.01013-17\u003c/span\u003e\u003cspan address=\"10.1128/jcm.01013-17\" targettype=\"DOI\" class=\"RefTarget\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eChen T, Guestrin C, XGBoost:. A Scalable Tree Boosting System. in \u003cem\u003eProceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining\u003c/em\u003e 785\u0026ndash;794Association for Computing Machinery, New York, NY, USA, (2016). \u003cspan class=\"ExternalRef\"\u003e\u003cspan class=\"RefSource\"\u003e10.1145/2939672.2939785\u003c/span\u003e\u003cspan address=\"10.1145/2939672.2939785\" targettype=\"DOI\" class=\"RefTarget\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eLi B, et al. Using Machine Learning (XGBoost) to Predict Outcomes After Infrainguinal Bypass for Peripheral Artery Disease. Ann Surg. 2024;279:705\u0026ndash;13.\u003c/span\u003e\u003c/li\u003e\u003cli\u003e\u003cspan\u003eWang R, Zhang J, Shan B, He M, Xu J. XGBoost Machine Learning Algorithm for Prediction of Outcome in Aneurysmal Subarachnoid Hemorrhage. Neuropsychiatr Dis Treat. 2022;18:659\u0026ndash;67.\u003c/span\u003e\u003c/li\u003e\u003c/ol\u003e"}],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":true,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":false,"hideJournal":true,"highlight":"","institution":"","isAcceptedByJournal":false,"isAuthorSuppliedPdf":false,"isDeskRejected":"","isHiddenFromSearch":false,"isInQc":false,"isInWorkflow":false,"isPdf":false,"isPdfUpToDate":true,"isWithdrawnOrRetracted":false,"journal":{"display":true,"email":"[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true},"keywords":"","lastPublishedDoi":"10.21203/rs.3.rs-7558046/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-7558046/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"\u003cp\u003eTuberculosis (TB) remains a global health crisis, with multidrug-resistant (MDR-TB) and extensively drug-resistant (XDR-TB) strains posing significant challenges to treatment. With the increasing availability of clinical and diagnostic data, artificial intelligence methods offer significant potential to transform treatment strategies and improve patient outcomes. In this study, we leveraged the comprehensive TB Portal database, which includes clinical, radiological, demographic, and genomic data from 15,997 patients across high-burden countries, to develop a machine learning model based on gradient-boosted decision trees for predicting tuberculosis treatment outcomes (e.g., success or failure). Using the open-source XGBoost library, our model categorises features into four temporally defined diagnostic stages, pre-treatment, microbiological, post-imaging, and treatment, aligning with the typical clinical workflow to support real-time decision-making. This stepwise framework enables the model to progressively incorporate available data while maintaining robust predictive performance, even in the presence of missing values typical of real-world healthcare settings. The model achieved high predictive accuracy (AUC-ROC: 0.96, F1-score: 0.94), with key predictors including age of onset, drug resistance, and treatment adherence. Regional analysis highlighted variability in performance, underscoring the potential for localised model adaptation. By accommodating missing data at various diagnostic stages, our model provides actionable insights for personalised TB treatment strategies and supports clinical decision-making in diverse and resource-constrained contexts.\u003c/p\u003e","manuscriptTitle":"A multi-stage machine learning framework for stepwise prediction of tuberculosis treatment outcomes: Integrating gradient boosted decision trees and feature-level analysis for clinical decision support","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2025-10-19 16:50:31","doi":"10.21203/rs.3.rs-7558046/v1","editorialEvents":[{"type":"communityComments","content":0}],"status":"published","journal":{"display":true,"email":"[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true}}],"origin":"","ownerIdentity":"a3ce8da5-0b10-40ba-b08a-1a92968c32f2","owner":[],"postedDate":"October 19th, 2025","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"posted","subjectAreas":[],"tags":[],"updatedAt":"2025-12-11T07:24:22+00:00","versionOfRecord":[],"versionCreatedAt":"2025-10-19 16:50:31","video":"","vorDoi":"","vorDoiUrl":"","workflowStages":[]},"version":"v1","identity":"rs-7558046","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-7558046","identity":"rs-7558046","version":["v1"]},"buildId":"8U1c8b4HqxoKbykW_rLl7","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[84888],"gssp":true,"scriptLoader":[]}

Text is read by the "Ask this paper" AI Q&A widget below. Extraction quality varies by source — PMC NXML preserves structure cleanly, OA-HTML may include some navigation residue, and OA-PDF can have broken hyphenation. The publisher copy (via DOI) is the canonical version.

My notes (saved in your browser only)

Ask this paper AI returns verbatim quotes from the full text · source: preprint-html

Answers must be backed by verbatim quotes from this paper's full text. Hallucinated quotes are dropped automatically; if no verbatim passage answers the question, we say so. How this works

Citation neighborhood (no data yet)

We don't have any in-corpus citations linked to this paper yet. This is a recent paper (2025) — citers typically take a year or two to land, and the OpenAlex reference graph may still be filling in.

Source provenance

europepmc
last seen: 2026-05-20T01:45:00.602351+00:00
unpaywall
last seen: 2026-05-21T05:10:58.409756+00:00
License: CC-BY-4.0