Based on five genes (DHRS9, HIST1H2BK, C16orf74, SLC30A1, and GBP1), the XGB model was selected as the optimal ML model for accurately determining TB subtype and disease status (active or latent). This evidence concerns the gene H2BC12 and tuberculosis.