# Prediction of Multidrug-Resistant Tuberculosis Using Machine Learning Algorithms in SWAT, Pakistan

Authors: Mian Haider Ali; Dost Muhammad Khan; Khalid Jamal; Zubair Ahmad; Sadaf Manzoor; Zardad Khan
Journal: Journal of Healthcare Engineering
 (2021)

---

## Abstract

In this paper, we have focused on machine learning (ML) feature selection (FS) algorithms for identifying and diagnosing multidrug-resistant (MDR) tuberculosis (TB). MDR-TB is a universal public health problem, and its early detection has been one of the burning issues. The present study has been conducted in the Malakand Division of Khyber Pakhtunkhwa, Pakistan, to further add to the knowledge on the disease and to deal with the issues of identification and early detection of MDR-TB by ML algorithms. These models also identify the most important factors causing MDR-TB infection whose study gives additional insights into the matter. ML algorithms such as random forest, k-nearest neighbors, support vector machine, logistic regression, leaset absolute shrinkage and selection operator (LASSO), artificial neural networks (ANNs), and decision trees are applied to analyse the case-control dataset. This study reveals that close contacts of MDR-TB patients, smoking, depression, previous TB history, improper treatment, and interruption in first-line TB treatment have a great impact on the status of MDR. Accordingly, weight loss, chest pain, hemoptysis, and fatigue are important symptoms. Based on accuracy, sensitivity, and specificity, SVM and RF are the suggested models to be used for patients’ classifications.


---

## Body

## 1. Introduction

The increasing demand for early detection, prognosis, and identification of resistant tuberculosis incidents remains the main issue universally and is needed to be addressed for the best interest of people. The deadliest multidrug-resistant tuberculosis (MDR-TB) is an airborne infectious disease spreading through coughing and sneezing from an infected person. M/DR-TB is defined as tuberculosis that shows resistance to at least one or both of the highest and most effective medicines that are rifampicin (RMP) and isoniazid (INH) with or without any additional first-line antituberculosis drugs (FLDs). Resistance is owing to defective treatment, ignorance, illiteracy, or improper management of the therapy of susceptible tuberculosis (S-TB), but some of these causes vary in different regions/countries but mostly the same in the majority of regions. Drug-resistant tuberculosis (DR-TB) has been a huge impediment to progressive tuberculosis control programs and is a looming threat to the world [1].Tuberculosis remains a widespread problem with the rising number of 10.0 million (ranging 1.1–13.3 million) cases composed of new and previously treated MTBC + cases of which 465,000 (ranging 400,000–535,000) are multidrug-resistant TB and rifampicin-resistant TB cases. This shows that the MDR-TB cases are recorded in an alarminingly large number [2]. The World Health Organization (WHO) stated that tuberculosis is one of the leading diseases that cause precious human loss universally and the leading cause of death from a single infectious agent (ranking above HIV/AIDS). In the year 2018, 186,772 confirmed MDR/RR-TB cases were detected globally, having a sharp rise from 160,684 in 2017. Regardless of noteworthy medical improvements and social interferences, controlling TB is vulnerable because the infected person can affect plenty of people by himself/herself. It is noteworthy to mention here that many infected patients are still hidden that can become the cause of widespread infection/disease dramatically [3, 4]. The hidden rifampicin-resistant (RR) cases have deteriorated health status progressively, and thus, this worldwide public health problem has increased further [5]. From the health statistics prospect, a weighty load that costs above twenty times the price of sensitive tuberculosis treatment is the drug-resistant tuberculosis (DR-TB) [6].Moreover, resistance to the pillar medicines in the first-line drugs tends to drug-resistant-TB, whereas drug-resistant tuberculosis therapy requires a lengthy treatment course from a newly introduced STR (short-term regimen) to LTR (long-term regimen), that is, from 9 months to 24 months. Second-line antituberculosis drugs (SLDs) are defined as the numerous reserve medications for DR-TB that are not easily available, excessively pricey, and are playing with fire compared to first-line antituberculosis drugs (FLDs). However, SLDs have been giving dissatisfactory clinical results in terms of adverse drug effects (ADEs). Many studies reported a treatment accomplishment rate of 60%–70% [7]. Furthermore, SLDs are toxic, complicated, take a lot of time, stimulating, and need extensive practice with ability, compared with FLDs. SLDs are not as much efficacious, imperfectly tolerated, and associated with widespread opposing effects as differentiated with the opening anti-TB therapy and are the principal instrument of disrupting the therapy. Programmatic management of drug-resistant tuberculosis (PMDT) has attained a considerable 80% heal rate in some locations but not acceptable in the majority [8]. Concern about SLDs is the unfavourable results that differ from minor (e.g., changes in skin colour, continuous pain in the head, and fluids from the body) to major danger (for example, liver diseases and kidney breakdown). A majority of the patients taking SLDs have observed ever-present adverse drug effects (such as mild stomach inflammation) and the main source of stopping the treatment. Besides, these medicines have also further wide-ranging consequences (such as a breakdown of the kidneys, liver diseases/hepatitis, severe stomach inflammation, severe mental disorder, and multiple diseases of the thyroid) that have appeared often, consequently causing more disturbances in the treatment [9].The main objectives of the present work are as follows:(i)
This study aims to analyse the risk factors and develop a model to early diagnose and predict the status of MDR-TB that could give guidelines to physicians in classifying high-risk patients and to help them in the treatment, prevention, and management(ii)
The second aim of this research work is to compare the predictive performance of different ML approaches upon which an appropriate model could be suggested


## 2. Related Work

Évora et al. [10] used ML methods for the identification of MDR-TB patients in the Brazilian city Rio de Janeiro. Case-control data of 280 samples of interest were collected from the National Reference Laboratory, Rio, from Febraury 2011 to May 2013 consisting of clinical and demographical information on the patients. On all presumptive samples with age 18 or 18+, current TB indicators were considered in the study. For the classification of RRD patients, classification and regression tree (CART) and artificial neural network (ANN) algorithms were employed. They achieved the highest 95.7%, 86.5%, and 88.1%, sensitivity, specificity, and accuracy, respectively, for the ANN model. Cavities on the lungs, history of TB, close contacts DR-TB, high temperature, coughing up blood, tobacco use, and shortness of breath are noted as the significant variables.Chen and Michael [11] obtained phenotyping and genome sequencing information of three thousand six hundred and one (3601) patients from WHO reference laboratories for the prognosis of pulmonary M/DR-TB, of which 1228 cases were RRD and the remaining were control. The aim of the study was to predict DRTB by machine learning algorithms including RF, logistic regression (LR), and deep neural network (DNN). Performance of the RF, DNN, and LR was assessed by specificity (SP), sensitivity (SN), and accuracy (ACC). The random forest ensemble model outperformed all the other models with SP = 92.7%, SN = 93.7%, and ACC = 97.9%. Blood in cough, close contact with DRTB patients, previous history of pulmonary TB, drug-addiction and alcohol use, improper medication management, and high temperature were noted as significant predictors.Computed tomography (CT) chest/lungs images and sputum smear-positive results of 230 DS-TB were obtained from the existing source by Gao and Qian [12] in 2017. The intent of the work was to label and prognosticate drug-resistant pulmonary-TB cases using ML approaches based on a simple-TB patient’s CT scans. CT lung images having irregular infiltration and cultured on restrained sections above the lungs were part of this study. For categorization and forecasting, convolutional neural network (CNN) and support vector machine (SVM) were employed by using R statistical language. The accuracy of CNN was recorded 91.11% and that of SVM as 79.80%. Moreover, the analysis successfully recognized the confirmed M/DR-TB patients.ML techniques were used to classify MTBC smear-negative pulmonary-TB patients by Mello et al. [13]. The span of the study was 3 years from April 1, 1995, to December 31, 1998. A toal of 551 cases were considered for the analysis recording current TB symptoms and radiological information such as cavities above the lungs. Cavity was regrouped as high, low, and atypical. Cavity above the upper region was labeled as low; areas with fluids, rashes, and lesions were labeled as high, and malformation/abnormal areas were labeled as atypical. Statistical analyses, particularly classification trees and regression, were carried out via S-Plus 4.5 and STATA 6.0. To assess the performance of the model, ROC and graphical illustration of the probability of detection against the probability of false, true positive rate (sensitivity), and the true negative rate were considered. The TPR and TNR of the ML predicting models were 71.0% and 76.0%, respectively. To check the statistical significance of the variables, the backward logistic regression model was utilized. Preceding TB treatment dose, alive TB bacteria case contact, elevated levels of glucose in the blood, smoking, and human immunosuppressed and HIV/AIDS were observed as the siginificant factors causing MDTB.Solari et al. [14] collected information from 487 suspected cases aged 18 or 18+ from August 1, 2002, to August 31, 2003. All the cases that had indications of pulmonary TB took part in the research. Factors considered were body temperature, weight loss, cough and hemoptysis, loss of appetite, and night sweats. Information was gathered using a questionnaire including questions on medical information, present TB indications, sociodemographic factors, previous TB history, other diseases, laboratory and X-rays information, and cavitation and infiltration above the chest. Step-wise logistic regression was used to analyse the collected data for the identification of important factors. All the independent predictors with p value <0.5 were kept for further analysis, whereas the rest of the factors were discarded. For model assessment, sensitivity, specificity, and ROC were used. Cavities and infiltrate above the upper lobe and previous PTB history were the important risk factors identified in the study.


## 3. Methodology

### 3.1. Data Collection

The duration of the data collection was from March 2018 to March 2019 at the PMDT site, GeneXpert sites of one teaching, and eight districts’ headquarter hospitals. Information was gathered from all the cases present at the programmatic management of drug-resistance tuberculosis centre for monthly follow-up and different TB-reference laboratories for sputum testing and diagnosis. The data collected from control and disease group along with sample size from different districts are shown in Table1. Inclusion criteria in the study were presumptive and confirmed MDR-TB cases including age 15 and 15+ with no gender discrimination, current TB indications such as cough, with or without blood, abnormal body temperature, losing body mass, loss of hunger, close contacts, old TB record, and the episodes of TB dosages, smoking, drug use, and alcohol use.Table 1
District-wise distribution of collected data
DistrictControl groupDisease groupSample sizeBajaur102030Buner211334Kohistan13720Lower Dir161733Malakand11213Shangla181735Swat87583Upper Dir161127Total113162275


### 3.2. Sample Size Determination

TheG∗ power software was used for the sample size determination having a type-1 error of 0.05 and power of the test 0.9.The interviewer assured all the the participants of the study that the information will be used for research purpose only and their personal and clinical particulars will be kept secret. A permission form was signed before gathering information from 275 pulmonary-TB symptomatic and multidrug-resistant group, and then, the interviewer started questioning using a state-of-the-art questionnaire designed with the help of experts. Particulars such as social and demographic, knowledge of DS/DR-TB and its treatment, TB background/history, other diseases such as HIV/AIDS, diabetes, and liver disease, current TB indicators, and Xpert MTB/RIF assay results were recorded. Sixteen and four cartridge GeneXpert machines were used for diagnosis.


### 3.3. Case-Control Group

In the present work, all individuals who suffered from DS-TB but not RR-TB were kept in the case-control group. Moreover, suspects exposed (close contact) to MDR-TB were also part of this group. Thus, the case-control group is composed of 113 samples.


### 3.4. Exclusion Criteria

All those having age 14 or less, psychological disability, and incapability to realize the goals and objectives of the study were excluded from the data collection.


### 3.5. Data Processing and Analysis

Transforming primary data into an advanced form by removing the missing variables in questionnaires having 40% or more information was carried out for the ML model development. Thus, the information of 275 samples was preprocessed. Data normalization was carried out before applying ML modelling. For validation purposes, data were split into 70% training and 30% testing sets.


### 3.6. Machine Learning Algorithms

Machine learning (ML) methods have been widely used for the analysis of medical data in the literature. Applications include prediction of disease, medical imaging, medical treatment planning and support, and overall patient management. Other applications are the detection of irregularities, cavitation, and handling missing observation in medical data. This study uses logistic regression, classification and regression trees, random forest, k-nearest neighbours, support vector machine, and artificial neural network methods for the analysis and binary classification. These methods are briefly described as follows.


#### 3.6.1. Decision Tree

Decision trees, also called classification and regression trees, are supervised machine learning algorithms used to build a training model to predict the value of a response/target variable by learning simple decision rules inferred from a given set of training data. A decision tree starts from a root node consisting of the whole set of training data further divided into two more homogeneous sets of data, called the subnodes. The subnodes are futher divided until a stoping criterion is met or all the observations in the node belong to the same class. For splitting each node, the best splitting variable and the best split point are chosen. The end nodes are called the leaf nodes and are used for classification and regression. A test observation is filtered through the tree and majority voting, or averaging is carried out to estimate the target value in the case of classification or regression, repectively [15, 16].


#### 3.6.2. Random Forest

Random Forest (RF) is an ensemble machine learning model used for classification and regression. Random forest predicts the response variable by using a multitude of trees from the given training data where a test observation is filtered through all the trees and majority voting or averaging is carried out for estimating the target value. For additional randomness in the base models, random forest considers a subsample of the input features for selecting the best splitting variable [17, 18].


#### 3.6.3. k-Nearest Neighbor

It is a simple memory-based leaning procedure used for classification and regression. k-NN algorithm identifies a set ofk-nearest observations to the test point, and the target value is estimated based on a majority voting rule [19].


#### 3.6.4. Support Vector Machine

A supervised ML approach classifies a response variable by drawing a decision boundery line. It was first introduced in 1995 for classification and is the only grouping approach that is based on the common features of the variables. The advantage of this approach is that it needs a very small training dataset for classification purposes and the procedure classifies the response variable into two groups without any huge computational labour [20].


#### 3.6.5. Artificial Neural Network

Artificial neural networks (ANNs), inspired by the human brain, consist of artificial neurons organized to perform certain tasks [21]. The methods have been widely used for solving clustering, classification, and pattern recognition tasks. ANN can be considered as weighted directed graphs with nodes as the artificial neurons and weighted connections between neuron inputs and neuron outputs as the directed edges. Input neurons receive data, and the output neurons give the desired variable values.The following metrics are used for assessing the prediction performance of the abovementioned machine learning methods:(1)AccuracyAC=TP+TNTP+FP+TN+FN,SensitivitySN=TPTP+FN,SpecificitySP=TNTN+FP.In the abovementioned expressions, the various notations are described as TP = true positive, TN = true negative, FP = false positive, and FN = false negative.Accuracy, sensitivity, and specificity are the terms that are most commonly associated with a binary classification that measures the performance of the classifier. In binary classification, we divide data into two categories based on whether they have common properties or not by using a binary classification test. Of these two categories, in general, sensitivity indicates how well the test predicts the positive category, and specificity measures how well the test predicts the negative category, whereas accuracy is expected to measure how well the test predicts both categories.


## 3.1. Data Collection

The duration of the data collection was from March 2018 to March 2019 at the PMDT site, GeneXpert sites of one teaching, and eight districts’ headquarter hospitals. Information was gathered from all the cases present at the programmatic management of drug-resistance tuberculosis centre for monthly follow-up and different TB-reference laboratories for sputum testing and diagnosis. The data collected from control and disease group along with sample size from different districts are shown in Table1. Inclusion criteria in the study were presumptive and confirmed MDR-TB cases including age 15 and 15+ with no gender discrimination, current TB indications such as cough, with or without blood, abnormal body temperature, losing body mass, loss of hunger, close contacts, old TB record, and the episodes of TB dosages, smoking, drug use, and alcohol use.Table 1
District-wise distribution of collected data
DistrictControl groupDisease groupSample sizeBajaur102030Buner211334Kohistan13720Lower Dir161733Malakand11213Shangla181735Swat87583Upper Dir161127Total113162275


## 3.2. Sample Size Determination

TheG∗ power software was used for the sample size determination having a type-1 error of 0.05 and power of the test 0.9.The interviewer assured all the the participants of the study that the information will be used for research purpose only and their personal and clinical particulars will be kept secret. A permission form was signed before gathering information from 275 pulmonary-TB symptomatic and multidrug-resistant group, and then, the interviewer started questioning using a state-of-the-art questionnaire designed with the help of experts. Particulars such as social and demographic, knowledge of DS/DR-TB and its treatment, TB background/history, other diseases such as HIV/AIDS, diabetes, and liver disease, current TB indicators, and Xpert MTB/RIF assay results were recorded. Sixteen and four cartridge GeneXpert machines were used for diagnosis.


## 3.3. Case-Control Group

In the present work, all individuals who suffered from DS-TB but not RR-TB were kept in the case-control group. Moreover, suspects exposed (close contact) to MDR-TB were also part of this group. Thus, the case-control group is composed of 113 samples.


## 3.4. Exclusion Criteria

All those having age 14 or less, psychological disability, and incapability to realize the goals and objectives of the study were excluded from the data collection.


## 3.5. Data Processing and Analysis

Transforming primary data into an advanced form by removing the missing variables in questionnaires having 40% or more information was carried out for the ML model development. Thus, the information of 275 samples was preprocessed. Data normalization was carried out before applying ML modelling. For validation purposes, data were split into 70% training and 30% testing sets.


## 3.6. Machine Learning Algorithms

Machine learning (ML) methods have been widely used for the analysis of medical data in the literature. Applications include prediction of disease, medical imaging, medical treatment planning and support, and overall patient management. Other applications are the detection of irregularities, cavitation, and handling missing observation in medical data. This study uses logistic regression, classification and regression trees, random forest, k-nearest neighbours, support vector machine, and artificial neural network methods for the analysis and binary classification. These methods are briefly described as follows.


### 3.6.1. Decision Tree

Decision trees, also called classification and regression trees, are supervised machine learning algorithms used to build a training model to predict the value of a response/target variable by learning simple decision rules inferred from a given set of training data. A decision tree starts from a root node consisting of the whole set of training data further divided into two more homogeneous sets of data, called the subnodes. The subnodes are futher divided until a stoping criterion is met or all the observations in the node belong to the same class. For splitting each node, the best splitting variable and the best split point are chosen. The end nodes are called the leaf nodes and are used for classification and regression. A test observation is filtered through the tree and majority voting, or averaging is carried out to estimate the target value in the case of classification or regression, repectively [15, 16].


### 3.6.2. Random Forest

Random Forest (RF) is an ensemble machine learning model used for classification and regression. Random forest predicts the response variable by using a multitude of trees from the given training data where a test observation is filtered through all the trees and majority voting or averaging is carried out for estimating the target value. For additional randomness in the base models, random forest considers a subsample of the input features for selecting the best splitting variable [17, 18].


### 3.6.3. k-Nearest Neighbor

It is a simple memory-based leaning procedure used for classification and regression. k-NN algorithm identifies a set ofk-nearest observations to the test point, and the target value is estimated based on a majority voting rule [19].


### 3.6.4. Support Vector Machine

A supervised ML approach classifies a response variable by drawing a decision boundery line. It was first introduced in 1995 for classification and is the only grouping approach that is based on the common features of the variables. The advantage of this approach is that it needs a very small training dataset for classification purposes and the procedure classifies the response variable into two groups without any huge computational labour [20].


### 3.6.5. Artificial Neural Network

Artificial neural networks (ANNs), inspired by the human brain, consist of artificial neurons organized to perform certain tasks [21]. The methods have been widely used for solving clustering, classification, and pattern recognition tasks. ANN can be considered as weighted directed graphs with nodes as the artificial neurons and weighted connections between neuron inputs and neuron outputs as the directed edges. Input neurons receive data, and the output neurons give the desired variable values.The following metrics are used for assessing the prediction performance of the abovementioned machine learning methods:(1)AccuracyAC=TP+TNTP+FP+TN+FN,SensitivitySN=TPTP+FN,SpecificitySP=TNTN+FP.In the abovementioned expressions, the various notations are described as TP = true positive, TN = true negative, FP = false positive, and FN = false negative.Accuracy, sensitivity, and specificity are the terms that are most commonly associated with a binary classification that measures the performance of the classifier. In binary classification, we divide data into two categories based on whether they have common properties or not by using a binary classification test. Of these two categories, in general, sensitivity indicates how well the test predicts the positive category, and specificity measures how well the test predicts the negative category, whereas accuracy is expected to measure how well the test predicts both categories.


## 3.6.1. Decision Tree

Decision trees, also called classification and regression trees, are supervised machine learning algorithms used to build a training model to predict the value of a response/target variable by learning simple decision rules inferred from a given set of training data. A decision tree starts from a root node consisting of the whole set of training data further divided into two more homogeneous sets of data, called the subnodes. The subnodes are futher divided until a stoping criterion is met or all the observations in the node belong to the same class. For splitting each node, the best splitting variable and the best split point are chosen. The end nodes are called the leaf nodes and are used for classification and regression. A test observation is filtered through the tree and majority voting, or averaging is carried out to estimate the target value in the case of classification or regression, repectively [15, 16].


## 3.6.2. Random Forest

Random Forest (RF) is an ensemble machine learning model used for classification and regression. Random forest predicts the response variable by using a multitude of trees from the given training data where a test observation is filtered through all the trees and majority voting or averaging is carried out for estimating the target value. For additional randomness in the base models, random forest considers a subsample of the input features for selecting the best splitting variable [17, 18].


## 3.6.3. k-Nearest Neighbor

It is a simple memory-based leaning procedure used for classification and regression. k-NN algorithm identifies a set ofk-nearest observations to the test point, and the target value is estimated based on a majority voting rule [19].


## 3.6.4. Support Vector Machine

A supervised ML approach classifies a response variable by drawing a decision boundery line. It was first introduced in 1995 for classification and is the only grouping approach that is based on the common features of the variables. The advantage of this approach is that it needs a very small training dataset for classification purposes and the procedure classifies the response variable into two groups without any huge computational labour [20].


## 3.6.5. Artificial Neural Network

Artificial neural networks (ANNs), inspired by the human brain, consist of artificial neurons organized to perform certain tasks [21]. The methods have been widely used for solving clustering, classification, and pattern recognition tasks. ANN can be considered as weighted directed graphs with nodes as the artificial neurons and weighted connections between neuron inputs and neuron outputs as the directed edges. Input neurons receive data, and the output neurons give the desired variable values.The following metrics are used for assessing the prediction performance of the abovementioned machine learning methods:(1)AccuracyAC=TP+TNTP+FP+TN+FN,SensitivitySN=TPTP+FN,SpecificitySP=TNTN+FP.In the abovementioned expressions, the various notations are described as TP = true positive, TN = true negative, FP = false positive, and FN = false negative.Accuracy, sensitivity, and specificity are the terms that are most commonly associated with a binary classification that measures the performance of the classifier. In binary classification, we divide data into two categories based on whether they have common properties or not by using a binary classification test. Of these two categories, in general, sensitivity indicates how well the test predicts the positive category, and specificity measures how well the test predicts the negative category, whereas accuracy is expected to measure how well the test predicts both categories.


## 4. Results and Discussion

The premier manifest of this work is to predict the status of multidrug-resistant tuberculosis and to identify the important factors that cause multidrug-resistant tuberculosis, using different ML classification procedures. Therefore, step-wise logistic regression and the machine learning methods given above along with FS by random forest, regression, and LASSO are used.


### 4.1. Multiple Logistic Regression

It is a special form of the generalized linear model that is used for the categorical response variable. Logistic regression predicts the probability of the occurrence of an event by fitting data to a logit function.Table2 gives the results of the step-wise logistic regression model. The model is fitted based on all the variables in the data. The fitted model keeps those variables that are statistically significant. It is to be noted that p=0.05 is used as a cutoff probability value for the rejection of the null hypothesis H0. The odds ratio (OR) is used for assessing independence with 95% confidence intervals. From Table 2, it can be seen that the previous history of tuberculosis with a p=0.026<0.05 is a statistically significant variable. Here, the OR=1.179>1.0 shows us that the odds of individuals having a TB history are almost 18% higher than those who do not have a TB history. The factors that are not statistically significant were noted as age, gender, marital status, education status, residence type, family type, employment status, wealth status, HBV, HCV, diabetes, silicosis (other lung diseases), other diseases, crowded place, alcohol, drug addict, snuffing, etc.Table 2
Variable selection via the logistic regression model. Smallp value indicates the significance of a variable.
VariableCoeff.S. E.p valueOR95% CI for ORLowerLowerPrevious TB history1.7190.7720.0261.1790.0392.485Improper treatment1.3760.5640.0153.9601.3127.951Smoking1.3440.6580.0413.8351.0578.915MDR close contact−2.0370.3980.0002.1300.0604.285Break-in TB medication−0.8340.2380.0000.4340.2720.893Malnutrition2.4791.0670.0016.4314.00612.55Hemoptysis (Produce cough)−1.7310.6680.0100.1770.0480.656Restless or fatigue−1.0560.3740.0050.3480.1670.724Depression−0.7230.3550.0410.4850.2420.972Chest pain2.3220.6790.00110.1952.69718.545Weight loss−1.0030.4360.0210.3670.1560.861


#### 4.1.1. Feature Selection by Random Forest

Random forest, a tree-based ensemble, can effectively be used as a feature selection method. This method ranks the features based on their contribution in the average Gini decrease while growing the ensemble and is, thus, called an embedded feature selection method. Features are selected using the training data, and then, the given classifiers are applied to the reduced data to check the effect of the feature selection on the classification performance of the methods. The results are given in Table3.Table 3
Results based on feature selection using random forest algorithm.
FeaturesAlgorithmAccuracySensitivitySpecificity5Logistic0.68910.8130.5187k-NN0.66870.75650.5502Tree0.6440.68660.5902R-forest0.71390.76450.6471SVM0.71430.78770.6156NN0.71980.75220.586910Logistic0.69850.77520.5956k-NN0.68670.72840.6315Tree0.6520.70530.5813R-forest0.71220.69920.7347SVM0.69970.77290.6024NN0.69130.66770.588915Logistic0.71180.75820.6504k-NN0.69520.71250.6745Tree0.65050.70290.5812R-forest0.74180.72670.7669SVM0.73330.78670.662NN0.7010.67590.591620Logistic0.69340.74750.6212k-NN0.67560.71240.6289Tree0.64780.70870.5662R-forest0.74270.73640.7549SVM0.73140.79320.6483NN0.69990.67720.586725Logistic0.68640.74570.605k-NN0.68740.72630.6364Tree0.6470.70050.5731R-forest0.74410.74670.7446SVM0.72820.79340.6391NN0.69110.67660.590530Logistic0.69140.72720.6441k-NN0.690.72940.6386Tree0.64720.70460.5682R-forest0.74470.74310.7512SVM0.72340.78990.6344NN0.70240.69070.5878In Table3, the top 5, 10, 15, 20, 25, and 30 features were selected using random forest algorithm and the performance metrics were calculated using the given algorithms, that is, logistic, K-NN, tree, R-forest, SVM, and NN. The best result is shown in bold. Table 3 gives the results based on features selected by random forest (70% training and 30% testing information). Accuracy, sensitivity, and specificity are estimated by the method taking 5, 10, 15, 20, 25, and 30 variables selected by random forest. The results given in bold-italic show the maximum accuracy, sensitivity, and specificity in each of the selected feature set. From the results, it is evident that RF recorded the maximum ACC and SP whereas SVM gave the maximum SN as compared with the other methods. Overall, random forest has outperformed all the other techniques. It is also evident from the results that a promising result can be achieved by using only a small (i.e., 5) number of features. This suggests that the cost and time of follow-up and obtaining the records can be significantly reduced by using the random forest as the feature selection method. However, increasing the number of features increases the overall performance of the methods. This has been further highlighted in Figure 1.Figure 1
Classification accuracy of the techniques based on different number of features.Figure2 shows variables importance, according to variable contribution in building random forest. The important variables identified here are close contacts of pulmonary MDR-TB patients, depression, does not take proper DSTB treatment, residence type, history of TB, poverty, fever, and continuous cough.Figure 2
Variable importance plot (using random forest).For better presentation, the classification accuracy of the methods is depicted in Figure1 for different number of features. The figure reveals that increasing the number of features from a certain point (different for different methods) does not increase the classification accuracy. Therefore, the analysis suggests that a significant decrease in cost and time, both in the data collection and analysis, could be brought by feature selection.One might argue that features selected by random forest will favour the random forest when used as a classifier. Therefore, other feature selection methods are also applied to tackle this issue.


#### 4.1.2. Feature Selection by Logistic Regression

Table4 displays the results based on features selected by logistic regression. It can be observed that RF recorded the maximum specificity and accuracy, while the maximum sensitivity is achieved by the SVM classifier.Table 4
Results based on feature selection using logistic regression algorithm.
FeaturesAlgorithmAccuracySensitivitySpecificity5Logistic0.69140.77920.5707k-NN0.66060.70040.6102Tree0.63570.6980.5512R-forest0.66750.65870.6862SVM0.67570.71820.622NN0.68260.6880.5910Logistic0.69260.74490.6212k-NN0.67770.71710.6275Tree0.62190.70250.5122R-forest0.69030.68880.6967SVM0.70050.77060.605NN0.67770.66950.590215Logistic0.68750.72690.6351k-NN0.65570.68110.6252Tree0.62050.73530.4599R-forest0.70090.70220.7036SVM0.70240.78290.5929NN0.68460.6660.589320Logistic0.67580.71130.6288k-NN0.66050.70170.6082Tree0.61510.76320.4104R-forest0.70210.72810.6698SVM0.69730.80350.5531NN0.66950.66660.587625Logistic0.65520.67420.6308k-NN0.64030.70530.5545Tree0.610.75250.4132R-forest0.71250.74270.6735SVM0.69520.80410.5463NN0.67210.65620.589530Logistic0.64270.64130.6469k-NN0.63030.71350.5177Tree0.6140.75560.4165R-forest0.70250.74350.6477SVM0.68030.8090.504NN0.66090.64780.588Table4 presents that the top 5, 10, 15, 20, 25, and 30 features are used and the performance metrics are calculated using the given algorithms. Figure 3 represents the accuracy of different classification methods using feature selection by random forest using 70% and 30% testing and training dataset, respectively. Random forest outperforms all the other algorithms. It can also be observed from Figure 4 that increasing the number of features from 15, the accuracy of the methods starts decreasing. Figure 4 also reveals that using as little as 10 features selected by logistic regression gives the optimal classification accuracy. Both random forest and logistic regression are used as feature selection, as well as classifiers. Therefore, the use of a feature selection method that is not used for classification is essential to assess all the methods on equal grounds. To this end, LASSO has been used as the feature selection method to further extend ML classifier capability for the prognosis. The results based on LASSO as the feature selection method are given in Table 5.Figure 3
Performance of different classification techniques using feature selection based on LASSO.Figure 4
Performance of different classification techniques using features selected based on logistic regression.Table 5
Results based on features selection by the LASSO technique.
FeaturesAlgorithmAccuracySensitivitySpecificity5Logistic0.69620.76340.6082k-NN0.68730.67850.7014Tree0.66830.7030.6246R-forest0.7180.72010.7163SVM0.7160.72550.7044NN0.71790.72770.591810Logistic0.7050.75930.6318k-NN0.6660.70.6233Tree0.65160.68650.6078R-forest0.71010.71160.7124SVM0.69970.77560.5954NN0.71060.7090.58815Logistic0.68990.74140.6223k-NN0.70050.720.6764Tree0.6490.7040.5782R-forest0.71530.70050.7405SVM0.70290.79060.5821NN0.71190.69340.587220Logistic0.71770.74810.6778k-NN0.69330.68970.7021Tree0.64810.69910.5772R-forest0.73080.70610.7699SVM0.70470.76570.6212NN0.72480.70090.590625Logistic0.7010.73580.6552k-NN0.69970.7290.6608Tree0.64580.69570.5788R-forest0.73730.73250.7474SVM0.72280.78390.639NN0.70320.69010.588830Logistic0.69060.72840.6408k-NN0.69890.73830.6483Tree0.64250.69820.5682R-forest0.73840.7420.7376SVM0.71780.78660.625NN0.69460.68360.5857


#### 4.1.3. Feature Selection by LASSO

This section provides the effect of feature selection on the classification performance of the methods by using LASSO as the feature selection method. The reason for doing this is to provide a set of selected features that does not favour any of the classifiers. The results are given in Table5.Table5 displays the results of the methods based on feature selection (in various numbers) by LASSO (70% training and 30% testing data). The results in the table revealed that the maximum average specificity and accuracy are obtained by RF, while SVM achieved the maximum sensitivity.Furthermore, Figure3 plots classification accuracy for different methods based on the different number of features selected by the LASSO method. A similar conclusion could be drawn from the figure as those of features selected by random forest and logistic regression. It is also worth mentioning that all the feature selection methods agree on almost the same significant features.Table5 presents that the top 5, 10, 15, 20, 25, and 30 features selected using the LASSO technique and the performance metrics are calculated using the given algorithms. Maximum studies have studied that 70% of the training data accurately and effectively train the model in order to diagnose, predict, and identify the disease. Therefore, in this paper, 70% and 30% of the given data are used as training and testing data, repectively. After extensive analysis via machine learning methods, it is found that close contacts of M/DR-TB patients, previous TB history, improper TB treatment, carelessness in first-line TB drugs, smoking, and depression are the major causes. It is necessary to mention here that LASSO, RF, and logistic feature selection algorithms agree on features TB history, close contacts, depression, forgetting TB medications, improper TB treatment, and smoking. Furthermore, it is also recommended that twenty of the considered total number of features could be used for the disease prediction to reduce the cost of follow-up in the study of the disease.


## 4.1. Multiple Logistic Regression

It is a special form of the generalized linear model that is used for the categorical response variable. Logistic regression predicts the probability of the occurrence of an event by fitting data to a logit function.Table2 gives the results of the step-wise logistic regression model. The model is fitted based on all the variables in the data. The fitted model keeps those variables that are statistically significant. It is to be noted that p=0.05 is used as a cutoff probability value for the rejection of the null hypothesis H0. The odds ratio (OR) is used for assessing independence with 95% confidence intervals. From Table 2, it can be seen that the previous history of tuberculosis with a p=0.026<0.05 is a statistically significant variable. Here, the OR=1.179>1.0 shows us that the odds of individuals having a TB history are almost 18% higher than those who do not have a TB history. The factors that are not statistically significant were noted as age, gender, marital status, education status, residence type, family type, employment status, wealth status, HBV, HCV, diabetes, silicosis (other lung diseases), other diseases, crowded place, alcohol, drug addict, snuffing, etc.Table 2
Variable selection via the logistic regression model. Smallp value indicates the significance of a variable.
VariableCoeff.S. E.p valueOR95% CI for ORLowerLowerPrevious TB history1.7190.7720.0261.1790.0392.485Improper treatment1.3760.5640.0153.9601.3127.951Smoking1.3440.6580.0413.8351.0578.915MDR close contact−2.0370.3980.0002.1300.0604.285Break-in TB medication−0.8340.2380.0000.4340.2720.893Malnutrition2.4791.0670.0016.4314.00612.55Hemoptysis (Produce cough)−1.7310.6680.0100.1770.0480.656Restless or fatigue−1.0560.3740.0050.3480.1670.724Depression−0.7230.3550.0410.4850.2420.972Chest pain2.3220.6790.00110.1952.69718.545Weight loss−1.0030.4360.0210.3670.1560.861


### 4.1.1. Feature Selection by Random Forest

Random forest, a tree-based ensemble, can effectively be used as a feature selection method. This method ranks the features based on their contribution in the average Gini decrease while growing the ensemble and is, thus, called an embedded feature selection method. Features are selected using the training data, and then, the given classifiers are applied to the reduced data to check the effect of the feature selection on the classification performance of the methods. The results are given in Table3.Table 3
Results based on feature selection using random forest algorithm.
FeaturesAlgorithmAccuracySensitivitySpecificity5Logistic0.68910.8130.5187k-NN0.66870.75650.5502Tree0.6440.68660.5902R-forest0.71390.76450.6471SVM0.71430.78770.6156NN0.71980.75220.586910Logistic0.69850.77520.5956k-NN0.68670.72840.6315Tree0.6520.70530.5813R-forest0.71220.69920.7347SVM0.69970.77290.6024NN0.69130.66770.588915Logistic0.71180.75820.6504k-NN0.69520.71250.6745Tree0.65050.70290.5812R-forest0.74180.72670.7669SVM0.73330.78670.662NN0.7010.67590.591620Logistic0.69340.74750.6212k-NN0.67560.71240.6289Tree0.64780.70870.5662R-forest0.74270.73640.7549SVM0.73140.79320.6483NN0.69990.67720.586725Logistic0.68640.74570.605k-NN0.68740.72630.6364Tree0.6470.70050.5731R-forest0.74410.74670.7446SVM0.72820.79340.6391NN0.69110.67660.590530Logistic0.69140.72720.6441k-NN0.690.72940.6386Tree0.64720.70460.5682R-forest0.74470.74310.7512SVM0.72340.78990.6344NN0.70240.69070.5878In Table3, the top 5, 10, 15, 20, 25, and 30 features were selected using random forest algorithm and the performance metrics were calculated using the given algorithms, that is, logistic, K-NN, tree, R-forest, SVM, and NN. The best result is shown in bold. Table 3 gives the results based on features selected by random forest (70% training and 30% testing information). Accuracy, sensitivity, and specificity are estimated by the method taking 5, 10, 15, 20, 25, and 30 variables selected by random forest. The results given in bold-italic show the maximum accuracy, sensitivity, and specificity in each of the selected feature set. From the results, it is evident that RF recorded the maximum ACC and SP whereas SVM gave the maximum SN as compared with the other methods. Overall, random forest has outperformed all the other techniques. It is also evident from the results that a promising result can be achieved by using only a small (i.e., 5) number of features. This suggests that the cost and time of follow-up and obtaining the records can be significantly reduced by using the random forest as the feature selection method. However, increasing the number of features increases the overall performance of the methods. This has been further highlighted in Figure 1.Figure 1
Classification accuracy of the techniques based on different number of features.Figure2 shows variables importance, according to variable contribution in building random forest. The important variables identified here are close contacts of pulmonary MDR-TB patients, depression, does not take proper DSTB treatment, residence type, history of TB, poverty, fever, and continuous cough.Figure 2
Variable importance plot (using random forest).For better presentation, the classification accuracy of the methods is depicted in Figure1 for different number of features. The figure reveals that increasing the number of features from a certain point (different for different methods) does not increase the classification accuracy. Therefore, the analysis suggests that a significant decrease in cost and time, both in the data collection and analysis, could be brought by feature selection.One might argue that features selected by random forest will favour the random forest when used as a classifier. Therefore, other feature selection methods are also applied to tackle this issue.


### 4.1.2. Feature Selection by Logistic Regression

Table4 displays the results based on features selected by logistic regression. It can be observed that RF recorded the maximum specificity and accuracy, while the maximum sensitivity is achieved by the SVM classifier.Table 4
Results based on feature selection using logistic regression algorithm.
FeaturesAlgorithmAccuracySensitivitySpecificity5Logistic0.69140.77920.5707k-NN0.66060.70040.6102Tree0.63570.6980.5512R-forest0.66750.65870.6862SVM0.67570.71820.622NN0.68260.6880.5910Logistic0.69260.74490.6212k-NN0.67770.71710.6275Tree0.62190.70250.5122R-forest0.69030.68880.6967SVM0.70050.77060.605NN0.67770.66950.590215Logistic0.68750.72690.6351k-NN0.65570.68110.6252Tree0.62050.73530.4599R-forest0.70090.70220.7036SVM0.70240.78290.5929NN0.68460.6660.589320Logistic0.67580.71130.6288k-NN0.66050.70170.6082Tree0.61510.76320.4104R-forest0.70210.72810.6698SVM0.69730.80350.5531NN0.66950.66660.587625Logistic0.65520.67420.6308k-NN0.64030.70530.5545Tree0.610.75250.4132R-forest0.71250.74270.6735SVM0.69520.80410.5463NN0.67210.65620.589530Logistic0.64270.64130.6469k-NN0.63030.71350.5177Tree0.6140.75560.4165R-forest0.70250.74350.6477SVM0.68030.8090.504NN0.66090.64780.588Table4 presents that the top 5, 10, 15, 20, 25, and 30 features are used and the performance metrics are calculated using the given algorithms. Figure 3 represents the accuracy of different classification methods using feature selection by random forest using 70% and 30% testing and training dataset, respectively. Random forest outperforms all the other algorithms. It can also be observed from Figure 4 that increasing the number of features from 15, the accuracy of the methods starts decreasing. Figure 4 also reveals that using as little as 10 features selected by logistic regression gives the optimal classification accuracy. Both random forest and logistic regression are used as feature selection, as well as classifiers. Therefore, the use of a feature selection method that is not used for classification is essential to assess all the methods on equal grounds. To this end, LASSO has been used as the feature selection method to further extend ML classifier capability for the prognosis. The results based on LASSO as the feature selection method are given in Table 5.Figure 3
Performance of different classification techniques using feature selection based on LASSO.Figure 4
Performance of different classification techniques using features selected based on logistic regression.Table 5
Results based on features selection by the LASSO technique.
FeaturesAlgorithmAccuracySensitivitySpecificity5Logistic0.69620.76340.6082k-NN0.68730.67850.7014Tree0.66830.7030.6246R-forest0.7180.72010.7163SVM0.7160.72550.7044NN0.71790.72770.591810Logistic0.7050.75930.6318k-NN0.6660.70.6233Tree0.65160.68650.6078R-forest0.71010.71160.7124SVM0.69970.77560.5954NN0.71060.7090.58815Logistic0.68990.74140.6223k-NN0.70050.720.6764Tree0.6490.7040.5782R-forest0.71530.70050.7405SVM0.70290.79060.5821NN0.71190.69340.587220Logistic0.71770.74810.6778k-NN0.69330.68970.7021Tree0.64810.69910.5772R-forest0.73080.70610.7699SVM0.70470.76570.6212NN0.72480.70090.590625Logistic0.7010.73580.6552k-NN0.69970.7290.6608Tree0.64580.69570.5788R-forest0.73730.73250.7474SVM0.72280.78390.639NN0.70320.69010.588830Logistic0.69060.72840.6408k-NN0.69890.73830.6483Tree0.64250.69820.5682R-forest0.73840.7420.7376SVM0.71780.78660.625NN0.69460.68360.5857


### 4.1.3. Feature Selection by LASSO

This section provides the effect of feature selection on the classification performance of the methods by using LASSO as the feature selection method. The reason for doing this is to provide a set of selected features that does not favour any of the classifiers. The results are given in Table5.Table5 displays the results of the methods based on feature selection (in various numbers) by LASSO (70% training and 30% testing data). The results in the table revealed that the maximum average specificity and accuracy are obtained by RF, while SVM achieved the maximum sensitivity.Furthermore, Figure3 plots classification accuracy for different methods based on the different number of features selected by the LASSO method. A similar conclusion could be drawn from the figure as those of features selected by random forest and logistic regression. It is also worth mentioning that all the feature selection methods agree on almost the same significant features.Table5 presents that the top 5, 10, 15, 20, 25, and 30 features selected using the LASSO technique and the performance metrics are calculated using the given algorithms. Maximum studies have studied that 70% of the training data accurately and effectively train the model in order to diagnose, predict, and identify the disease. Therefore, in this paper, 70% and 30% of the given data are used as training and testing data, repectively. After extensive analysis via machine learning methods, it is found that close contacts of M/DR-TB patients, previous TB history, improper TB treatment, carelessness in first-line TB drugs, smoking, and depression are the major causes. It is necessary to mention here that LASSO, RF, and logistic feature selection algorithms agree on features TB history, close contacts, depression, forgetting TB medications, improper TB treatment, and smoking. Furthermore, it is also recommended that twenty of the considered total number of features could be used for the disease prediction to reduce the cost of follow-up in the study of the disease.


## 4.1.1. Feature Selection by Random Forest

Random forest, a tree-based ensemble, can effectively be used as a feature selection method. This method ranks the features based on their contribution in the average Gini decrease while growing the ensemble and is, thus, called an embedded feature selection method. Features are selected using the training data, and then, the given classifiers are applied to the reduced data to check the effect of the feature selection on the classification performance of the methods. The results are given in Table3.Table 3
Results based on feature selection using random forest algorithm.
FeaturesAlgorithmAccuracySensitivitySpecificity5Logistic0.68910.8130.5187k-NN0.66870.75650.5502Tree0.6440.68660.5902R-forest0.71390.76450.6471SVM0.71430.78770.6156NN0.71980.75220.586910Logistic0.69850.77520.5956k-NN0.68670.72840.6315Tree0.6520.70530.5813R-forest0.71220.69920.7347SVM0.69970.77290.6024NN0.69130.66770.588915Logistic0.71180.75820.6504k-NN0.69520.71250.6745Tree0.65050.70290.5812R-forest0.74180.72670.7669SVM0.73330.78670.662NN0.7010.67590.591620Logistic0.69340.74750.6212k-NN0.67560.71240.6289Tree0.64780.70870.5662R-forest0.74270.73640.7549SVM0.73140.79320.6483NN0.69990.67720.586725Logistic0.68640.74570.605k-NN0.68740.72630.6364Tree0.6470.70050.5731R-forest0.74410.74670.7446SVM0.72820.79340.6391NN0.69110.67660.590530Logistic0.69140.72720.6441k-NN0.690.72940.6386Tree0.64720.70460.5682R-forest0.74470.74310.7512SVM0.72340.78990.6344NN0.70240.69070.5878In Table3, the top 5, 10, 15, 20, 25, and 30 features were selected using random forest algorithm and the performance metrics were calculated using the given algorithms, that is, logistic, K-NN, tree, R-forest, SVM, and NN. The best result is shown in bold. Table 3 gives the results based on features selected by random forest (70% training and 30% testing information). Accuracy, sensitivity, and specificity are estimated by the method taking 5, 10, 15, 20, 25, and 30 variables selected by random forest. The results given in bold-italic show the maximum accuracy, sensitivity, and specificity in each of the selected feature set. From the results, it is evident that RF recorded the maximum ACC and SP whereas SVM gave the maximum SN as compared with the other methods. Overall, random forest has outperformed all the other techniques. It is also evident from the results that a promising result can be achieved by using only a small (i.e., 5) number of features. This suggests that the cost and time of follow-up and obtaining the records can be significantly reduced by using the random forest as the feature selection method. However, increasing the number of features increases the overall performance of the methods. This has been further highlighted in Figure 1.Figure 1
Classification accuracy of the techniques based on different number of features.Figure2 shows variables importance, according to variable contribution in building random forest. The important variables identified here are close contacts of pulmonary MDR-TB patients, depression, does not take proper DSTB treatment, residence type, history of TB, poverty, fever, and continuous cough.Figure 2
Variable importance plot (using random forest).For better presentation, the classification accuracy of the methods is depicted in Figure1 for different number of features. The figure reveals that increasing the number of features from a certain point (different for different methods) does not increase the classification accuracy. Therefore, the analysis suggests that a significant decrease in cost and time, both in the data collection and analysis, could be brought by feature selection.One might argue that features selected by random forest will favour the random forest when used as a classifier. Therefore, other feature selection methods are also applied to tackle this issue.


## 4.1.2. Feature Selection by Logistic Regression

Table4 displays the results based on features selected by logistic regression. It can be observed that RF recorded the maximum specificity and accuracy, while the maximum sensitivity is achieved by the SVM classifier.Table 4
Results based on feature selection using logistic regression algorithm.
FeaturesAlgorithmAccuracySensitivitySpecificity5Logistic0.69140.77920.5707k-NN0.66060.70040.6102Tree0.63570.6980.5512R-forest0.66750.65870.6862SVM0.67570.71820.622NN0.68260.6880.5910Logistic0.69260.74490.6212k-NN0.67770.71710.6275Tree0.62190.70250.5122R-forest0.69030.68880.6967SVM0.70050.77060.605NN0.67770.66950.590215Logistic0.68750.72690.6351k-NN0.65570.68110.6252Tree0.62050.73530.4599R-forest0.70090.70220.7036SVM0.70240.78290.5929NN0.68460.6660.589320Logistic0.67580.71130.6288k-NN0.66050.70170.6082Tree0.61510.76320.4104R-forest0.70210.72810.6698SVM0.69730.80350.5531NN0.66950.66660.587625Logistic0.65520.67420.6308k-NN0.64030.70530.5545Tree0.610.75250.4132R-forest0.71250.74270.6735SVM0.69520.80410.5463NN0.67210.65620.589530Logistic0.64270.64130.6469k-NN0.63030.71350.5177Tree0.6140.75560.4165R-forest0.70250.74350.6477SVM0.68030.8090.504NN0.66090.64780.588Table4 presents that the top 5, 10, 15, 20, 25, and 30 features are used and the performance metrics are calculated using the given algorithms. Figure 3 represents the accuracy of different classification methods using feature selection by random forest using 70% and 30% testing and training dataset, respectively. Random forest outperforms all the other algorithms. It can also be observed from Figure 4 that increasing the number of features from 15, the accuracy of the methods starts decreasing. Figure 4 also reveals that using as little as 10 features selected by logistic regression gives the optimal classification accuracy. Both random forest and logistic regression are used as feature selection, as well as classifiers. Therefore, the use of a feature selection method that is not used for classification is essential to assess all the methods on equal grounds. To this end, LASSO has been used as the feature selection method to further extend ML classifier capability for the prognosis. The results based on LASSO as the feature selection method are given in Table 5.Figure 3
Performance of different classification techniques using feature selection based on LASSO.Figure 4
Performance of different classification techniques using features selected based on logistic regression.Table 5
Results based on features selection by the LASSO technique.
FeaturesAlgorithmAccuracySensitivitySpecificity5Logistic0.69620.76340.6082k-NN0.68730.67850.7014Tree0.66830.7030.6246R-forest0.7180.72010.7163SVM0.7160.72550.7044NN0.71790.72770.591810Logistic0.7050.75930.6318k-NN0.6660.70.6233Tree0.65160.68650.6078R-forest0.71010.71160.7124SVM0.69970.77560.5954NN0.71060.7090.58815Logistic0.68990.74140.6223k-NN0.70050.720.6764Tree0.6490.7040.5782R-forest0.71530.70050.7405SVM0.70290.79060.5821NN0.71190.69340.587220Logistic0.71770.74810.6778k-NN0.69330.68970.7021Tree0.64810.69910.5772R-forest0.73080.70610.7699SVM0.70470.76570.6212NN0.72480.70090.590625Logistic0.7010.73580.6552k-NN0.69970.7290.6608Tree0.64580.69570.5788R-forest0.73730.73250.7474SVM0.72280.78390.639NN0.70320.69010.588830Logistic0.69060.72840.6408k-NN0.69890.73830.6483Tree0.64250.69820.5682R-forest0.73840.7420.7376SVM0.71780.78660.625NN0.69460.68360.5857


## 4.1.3. Feature Selection by LASSO

This section provides the effect of feature selection on the classification performance of the methods by using LASSO as the feature selection method. The reason for doing this is to provide a set of selected features that does not favour any of the classifiers. The results are given in Table5.Table5 displays the results of the methods based on feature selection (in various numbers) by LASSO (70% training and 30% testing data). The results in the table revealed that the maximum average specificity and accuracy are obtained by RF, while SVM achieved the maximum sensitivity.Furthermore, Figure3 plots classification accuracy for different methods based on the different number of features selected by the LASSO method. A similar conclusion could be drawn from the figure as those of features selected by random forest and logistic regression. It is also worth mentioning that all the feature selection methods agree on almost the same significant features.Table5 presents that the top 5, 10, 15, 20, 25, and 30 features selected using the LASSO technique and the performance metrics are calculated using the given algorithms. Maximum studies have studied that 70% of the training data accurately and effectively train the model in order to diagnose, predict, and identify the disease. Therefore, in this paper, 70% and 30% of the given data are used as training and testing data, repectively. After extensive analysis via machine learning methods, it is found that close contacts of M/DR-TB patients, previous TB history, improper TB treatment, carelessness in first-line TB drugs, smoking, and depression are the major causes. It is necessary to mention here that LASSO, RF, and logistic feature selection algorithms agree on features TB history, close contacts, depression, forgetting TB medications, improper TB treatment, and smoking. Furthermore, it is also recommended that twenty of the considered total number of features could be used for the disease prediction to reduce the cost of follow-up in the study of the disease.


## 5. Conclusions and Recommendation

Multidrug-resistant tuberculosis is a common disease, and many studies have been conducted to predict the occurrence of MDR-TB and to determine the possible risk factors for these fatal diseases. This work aimed at identifying the most significant variables that contribute positively to developing multidrug-resistant tuberculosis.All the classification methods which were used for the prognosis of the disease performed well, whereas it is quite clear from the analyses that the random forest and support vector machine classifier select the best subset of features for classification and predicting the response variable. The efficiency of the six different classification techniques including logistic regression, K-NN, decision tree, random forest, SVM, the neural network was measured. Accuracy, sensitivity, and specificity were used to assess the overall performance of the techniques.On average, the values of accuracy and specificity of the random forest classifier are better than those of the other classifiers, while in terms of sensitivity, the support vector network classifier showed the best performance. Thus, random forest and support vector machine classifiers outperformed all. Therefore, based on the computed outcome, random forest and support vector machines are recommended for the classification and prediction of disease.The results of this study suggest that the machine learning classification model such as the support vector machine and random forest classification model accurately predicts multidrug-resistant tuberculosis patients using a small number of variables. This might be helpful for the physicians in the classification of high-risk group patients and the diagnosis and prevention of MDR-TB.In a nutshell, consistent with the literature [22–24], our findings indicated that close contacts of the MDR-TB patient, smoking, depression, previous tuberculosis history, improper treatment, and interruption in DSTB treatment have a significant impact on the status of MDR. Accordingly, weight loss, chest pain, hemoptysis, fatigue, and malnutrition are the leading important variables that have been playing a significant role in developing multidrug-resistant tuberculosis.This research will help the pulmonologists and physicians in assessing and classifying high-risk group patients in the diagnosis and epidemiologists and public health specialists in prevention of MDR-TB infection. This work is also productive for the vision of the World Health Organization to end TB.In the current research work, only demographic, medical, and psychological information is included, but for future work, chest X-rays and chest scans could also be considered for further insights. Additional feature selection methods [25–29] and classifiers [30, 31] could also be used for further investigation. The same algorithms could also be extended for the prediction of binding of G-protein-coupled receptors (GPCRs) and ligands using machine learning algorithms [32] and biomedical image classification in a big data architecture [33].



---

*Source: 2567080-2021-09-01.xml*