## 2 Materials and Methods
### Data Preprocessing  
In this study, the nested cross-validation (nested CV) procedure is employed to estimate the skill of the models. The nested CV is an essential method in the application of ML for medical diagnosis because of the limited data available for training ML models in the healthcare domain [32]. The nested cross-validation method is a double cross-validation technique, where the k-fold cross-validation for model hyperparameter tuning is nested inside the k-fold cross-validation for model selection. Model selection without nested CV applies the same data to tune the model and evaluate performance, which could result in data leakage and overfitting. The k-fold cross-validation method entails training a model using all folds except one and testing the trained model using the holdout fold. Assuming that the combination of folds used to fit the model is called the training dataset and the held-out fold is the test dataset, then each training dataset is coupled with the grid search optimization technique to obtain the best hyperparameter combination for the model. Meanwhile, another k-fold cross-validation is employed to evaluate the hyperparameter combinations, and it divides the previously obtained training dataset into k-folds [33]. Therefore, the nested CV approach ensures that the grid search process does not result in a model that overfits the original dataset and results in a less biased performance estimate of the optimized model. Meanwhile, a patient's medical record contains a lot of information about the patient's medical history. Hence, a medical record that has not been prepared or processed for this type of study can be highly unstructured and contain much redundant information. This type of redundant information could affect the machine learning model. To overcome this challenge, preprocessing the hepatitis dataset becomes increasingly essential. The dataset used in this study contains missing values, and the listwise deletion technique is applied to handle the missing data. Since the rows with missing values are few, listwise deletion would be an effective method to avoid bias in the dataset [34]. Secondly, the min-max normalization [35] is applied for effective feature scaling. The technique is employed to normalize the data, which is necessary when dealing with distance and gradient descent-based algorithms, such as SVM and logistic regression, respectively. Meanwhile, the normalization is not applied on all the samples in the dataset to avoid data leakage, but rather a modeling pipeline is used, which defines a sequence of data preparation steps to be performed that end with fitting and evaluating the model. The modeling pipeline is obtained using the scikit-learn pipeline module [36], ensuring the normalization is fit on the training set only. The normalization is performed as follows:  
1. Fit the scaler using training data, i.e., using the fit() function to estimate the minimum and maximum values. 2. Apply the scale to the training dataset, i.e., using the transform() function to normalize the data that would be used to train the model. 3. Subsequently, apply only the scale on the test set. \begin{table}
\begin{tabular}{c c c c} \hline
**S/N** & **Attribute** & **Type** & **Description** \\ \hline
12 & Spiders & Nominal & Abnormal collection of blood vessels clustered near the skin surface \\ \hline
13 & Ascites & Nominal & Abnormal accumulation of fluids in the abdomen \\ \hline
14 & Varices & Nominal & Enlarged veins \\ \hline
15 & Bilirubin & Numeric & Yellowship pigment formed after the breakdown of red blood cells. \\ \hline
16 & Alk\_Phosphate & Numeric & Used for screening fibrosis levels \\ \hline
17 & Sgot & Numeric & Liver enzyme \\ \hline
18 & Albumin & Numeric & Protein made by the liver \\ \hline
19 & Protime & Numeric & Protein made by the liver \\ \hline
20 & Histology & Nominal & Microscopy study of the liver \\ \hline \end{tabular}
\end{table} 
Table 1: Cont.