Multiclass Outcome Analysis of Tuberculosis Clinical Care Pathways Using National Healthcare Claims Data and Machine Learning
Abstract
Healthcare insurance claims data can be utilized to analyze service outcomes at the population level; however, their use in predictive modeling still faces challenges related to extreme class imbalance and potential data leakage. This study develops a leakage-aware machine learning pipeline for multiclass classification of four tuberculosis patient service outcomes, namely Recovered, Died, Referred, and Discharged Against Medical Advice, using Indonesia’s national healthcare claims dataset (BPJS Kesehatan), which comprises 633,493 service episodes. To reduce the risk of data leakage, this study applies an 80/20 Stratified Group-based Split based on patient identity and excludes potentially leakage-prone administrative membership variables before model training. To address class imbalance, the Synthetic Minority Over-sampling Technique (SMOTE) is applied exclusively to the training data. Comparative experiments are conducted using Logistic Regression, Random Forest, and XG-Boost. The evaluation results show that Random Forest achieves the highest Macro F1-score of 0.361, while XGBoost achieves the highest PR-AUC of 0.386. The feature importance analysis indicates that claim cost, BPJS-verified claim amount, length of stay, and RJTL/RITL service indicators are among the most informative pathway features for distinguishing variations in service outcomes. These findings suggest that the combination of patient-level data splitting, leakage-prone feature exclusion, class imbalance handling, and ensemble learning models can support the identification of tuberculosis service outcome patterns based on national healthcare claims data.