###### Abstract  
This study is based on the consideration that the patients with rheumatoid arthritis and ankylosing spondylitis undergoing biological therapy have a higher risk of developing tuberculosis. The QuantiFERON-TB Gold test result was the output of the models and a series of features related to the patients and their treatments were chosen as inputs. A distribution of patients by gender and biological therapy, followed at the time of inclusion in the study, and at the end of the study, is made for both rheumatoid arthritis and ankylosing spondylitis. A series of classification algorithms (random forest, nearest neighbor, k-nearest neighbors, C4.5 decision trees, non-nested generalized exemplars, and support vector machines) and attribute selection algorithms (ReliefF, InfoGain, and correlation-based feature selection) were successfully applied. Useful information was obtained regarding the influence of biological and classical treatments on tuberculosis risk, and most of them agreed with medical studies. rheumatoid arthritis; ankylosing spondylitis; tuberculosis; machine learning algorithms; classification Article  
1  
[PERSON], A. M.  
set. From the three candidate machine learning algorithms (naive bayes, random forest, and sequential minimal optimization), random forest had the best performance in the leave-one-out cross-validation procedure, and it was selected to create a classification model. The model was validated in the second cohort of patients, with an accuracy of 89% correctly classified instances and 89% sensitivity [3]. In a study conducted by [PERSON]. [4], 17 patients with early rheumatoid arthritis were evaluated at baseline for gene expression profiles. After a mean of 5 years, their disease status was evaluated using a combined index (pain, and the global and recoded modified health assessment questionnaire (MHAQ) scores). Nineteen \"predictor genes\" of future disease severity were identified using a supervised t-test analysis. The results were validated in an independent cohort of RA patients using two supervised machine learning algorithms: support vector machines (SVM) and k-nearest-neighbor classification (kNN). The study demonstrated that the peripheral blood gene expression profiles can predict future disease severity in patients with early and established RA. In another study [5], ribonucleic acid (RNA) from peripheral blood mononuclear cells (PBMCs) of 9 RA patients and 13 healthy volunteers was analyzed on an oligonucleotide array. Twenty-nine transcripts were identified that were preferentially expressed in RA patients and a list of predictor genes was assembled using the k-nearest neighbor method. The study concluded that analysis of RA PBMCs may provide a set of candidate genes that could aid in the early diagnosis and treatment of RA patients. A study published in 2020 [6], compared the relative efficacy of infliximab (IFX) at 5 mg/kg and intravenous golimumab (GOL IV) at 2 mg/kg in ankylosing spondylitis patients. The nearest neighbor matching algorithm was used to match patients from the GOL IV group with patients from the IFX group. The GOL IV group showed significantly greater improvements in ASAS20 responses than the IFX group for weeks 28 to 44 in AS patients. The GOL IV group was comparable to the IFX group in changes from the baseline Bath Ankylosing Spondylitis Functional Index (BASFI) scores and C-reactive protein (CRP) levels. In a retrospective study conducted by [PERSON]. [7], two independent axial spondyloarthritis (axSpA) groups were used as training and testing datasets. They tested the feasibility of supervised machine learning algorithms to predict radiographic progression in axSpA patients. Radiographic progression was identified in 25.3% and 23.7% of patients in each group. Five classifiers were used in order to obtain a consensus-based classification for the phenrogroups: a generalized linear model (GLM), decision trees (DT), k-nearest-neighbors (kNN), support vector machines (SVM), and naive bayes (NB).