## 2 Methodology
### Dataset Description and Preprocessing
This process guarantees that the worst-case scenario from the two columns is appropriately represented by the combined severity level. The max operation is a dependable method of combining severity scales when the objective is to identify the most severe medical condition. Figure 4 displays the dataset following the application of the max operation. Figure 5 illustrates the results of the disease severity. Absent (1) was mapped to binary 0 using custom mapping, and very-low to very-severe (2 to 6) were mapped to binary 1. A lambda function mapping the disease severity to 0 and 1 was employed, with _condition 0 if_\(x=1\)_else_ 1. By mapping the diseases, the dataset was prepared, and the disease severity was represented in a straightforward, binary format for efficient training of machine learning models. Three machine learning algorithms were taken into consideration in this study: MLP, RF, XGBoost, and Random Forest, which was the model with the highest performance and was used to develop the diagnostic system. Using multiple decision trees, the RF model leveraged the power of ensemble learning to provide reliable diagnoses. Each tree independently predicts a possible diagnosis based on the input symptoms, and the final diagnosis is determined by aggregating these predictions through majority voting. This ensemble approach enhances the diagnostic performance of febrile diseases. RF uses patient data, including symptoms and diseases, to construct numerous decision trees on identical nodes. Then, it combines the decisions from these decision trees to arrive at a solution that is the average of all the decision trees [25]. XGBoost was chosen due to its advanced gradient boosting implementation and ensemble technique, which makes it a portable, flexible, and efficient option for disease diagnosis. XGBoost builds classification trees sequentially, training the subsequent tree with the residuals from the previous tree. As its basis, XGBoost uses gradient-boosted decision trees and regularization techniques  
Figure 4: Pre-processed dataset after max operation. to enhance model generalization. In a stepwise fashion, weak learners are progressively added to the group, with each member concentrating on fixing the mistakes of the others. It minimizes a predetermined loss function during training using the gradient descent optimization technique [25; 26]. MLP was also chosen due to its capacity to model intricate relationships, learn from high-dimensional datasets, and handle various data types, making it a useful tool for disease diagnosis [27]. When paired with the right interpretability and training strategies, MLPs can provide accurate and useful information for medical diagnosis. This feedforward artificial neural network consists of three layers: an output layer, one or more hidden layers, and an input layer. The dataset consisted of 3914 patient records after preprocessing, distributed as follows: malaria (2719), typhoid fever (1157), HIV/AIDS (424), urinary tract infection (907), respiratory tract infection (1094), and tuberculosis (381). The class distribution of the training and testing sets, obtained by allocating 80% of the dataset for training and 20% for testing, is shown in Table 4.  
To optimize the model's performance, hyperparameter tuning was carried out using Grid search cross-validation (GridSearchCV) with 5-fold cross-validation (CV = 5). For cross-validation, the training data were split into five equal subsets or folds. The model was trained on four folds, and testing was done on the last fold. This procedure was carried out five times, each time using a different fold as the test set to ensure that every observation in the training data was used for validation. Cross-validation is a helpful method for assessing the model's resilience and reducing the possibility of overfitting. Finding the best hyperparameters is also aided by averaging the performance across all folds.