## 2 Methodology
### Dataset Description and Preprocessing
The hyperparameters for each model were adjusted using GridSearchCV to determine which  
Figure 5: Pre-processed dataset after custom mapping. \begin{table}
\begin{tabular}{l l l l} \hline \hline
**Disease** & **Total Cases** & **Training Set (80\%)** & **Test Set (20\%)** \\ \hline Malaria & 2719 & 2175 & 544 \\ Typhoid fever & 1157 & 926 & 231 \\ HIV/AIDS & 424 & 339 & 85 \\ Urinary tract infection & 907 & 726 & 181 \\ Respiratory tract infection & 1094 & 875 & 219 \\ Tuberculosis & 381 & 305 & 76 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Class distribution of training and testing sets after dataset splitting. combination produced the best results. Hyperparameter tuning is used to optimize the model's performance by controlling how it learns from the data, and it has a significant impact on the model's performance and efficiency. For Random Forest (RF), max_depth, which specifies the maximum depth of each tree, was set to [None, 10, 20], and n_estimators, which determines the number of trees in the forest, was tested with values [100, 200, 300]. For the Multi-Layer Perceptron (MLP), three hyperparameters were adjusted: the activation function (which transforms input data in the neural network) with [\"relu\", \"tanh\", \"logistic\"), the regularization term alpha with [0.0001, 0.001, 0.01], and the hidden_layer_sizes (number of neurons in each layer) with [(100,), (50, 50), (50, 25, 10)]. Finally, for XGBoost, [100, 200, 300] and [3, 5, 7] were used to adjust the n_estimators and max_depth parameters. The pseudocode given in Algorithm 1 describes the detailed process used in this study, which includes the data split, severity combination, hyperparameters, model selection, interpretability with LIME, and ChatGPT integration for improved explanation. ```
BEGIN # Step 1: Dataset Preparation Load dataset D = [X, Y] Preprocess dataset Split dataset into training and testing: D_train, D_test \(\leftarrow\) split(D, 0.8) # Step 2: Severity Combination Using Max Operation FOR each patient record DO M(U, L) \(\leftarrow\) max(U, L) # Combine severity scores # Step 3: Hyperparameter Tuning and Model Training # Random Forest (RF) RF_params = [max_depth: [None, 10, 20], n_estimators: [100, 200, 300]] best_RF \(\leftarrow\) GridSearchCV(RandomForest, RF_params, D_train) # Multi-layer Perceptron (MLP) MLP_params = [activation: [\"relu\", \"tanh\", \"logistic\"], alpha: [0.0001, 0.001, 0.01] hidden_layer_sizes: [(100,), (50, 50), (50, 25, 10)] best_MLP \(\leftarrow\) GridSearchCV(MLP, MLP_params, D_train) # XGBoost XGBoost XGB_params = [n_estimators: [100, 200, 300], max_depth: [3, 5, 7]] best_XGB \(\leftarrow\) GridSearchCV(XGBoost, XGB_params, D_train) # Step 4: Model Selection Evaluate best_RF, best_MLP, best_XGB on D_test Select best_model \(\leftarrow\) model with highest F1 score # Step 5: Interpretability with LIME FOR each prediction in D_test DO explanation \(\leftarrow\) LIME(best_model, X_test) # Step 6: ChatGPT Integration for Enhanced Explanation FOR each patient DO P \(\leftarrow\) [best_model_prediction, explanation] response \(\leftarrow\) ChatGPT(P) # Step 7: Deployment FOR each patient DO Display [best_model_prediction, M(U, L), explanation, response] END
```  
**Algorithm 1** Explainable AI-based febrile disease diagnosis with hyperparameter tuning pseudocode