## 3 Methodology
### Model Evaluation  
The evaluation of the models entailed two differentiated phases. The first phase consisted of an evaluation of the statistical results by machine learning models using a subset of 1864 test slides, which comprised 30% of the total dataset. To evaluate the performance of the developed classification models, different metrics were employed as follows: the confusion matrix, classification error rate, area under the curve, and combined performance. The confusion matrix shows the number of times the model correctly or incorrectly predicted each of the classes in the classification problem. It has four main elements: true positives (TP), false positives (FP), true negatives (TN), and false negatives (FN). The classification error rate or classification error (error) is a metric used to evaluate the performance of a classification model. It is defined as the proportion of incorrect predictions made by the model relative to the total number of predictions made. A high classification error rate indicates that the model struggles to correctly classify the samples into their respective classes. This suggests that the model may not be suitable for a given dataset. The error rate can be calculated using Equation (1):  
\[\text{Error}=\frac{\text{FP}+\text{FN}}{\text{TP}+\text{TN}+\text{FP}+\text {FN}} \tag{1}\]  
The area under the curve (AUC) is a metric used to evaluate the performance of binary classification models. AUC refers to the area under the receiver operating characteristic (ROC) curve, which is a graphical representation of the relationship between the true positive rate (TPR, Equation (2)) and the false positive rate (FPR, Equation (3)) across different decision thresholds. \[\text{TPR}=\frac{\text{TP}}{\text{TP}+\text{FN}} \tag{2}\]  
\[\text{FPR}=\frac{\text{FP}}{\text{TN}+\text{FP}} \tag{3}\]  
The AUC ranges from 0 to 1: a value of 1 indicates the perfect ability of the model to distinguish between classes; a value of 0.5 indicates random performance. The AUC provides a balanced assessment of the model's performance by considering its ability to distinguish between both classes. The combined performance (PC) combines two model evaluation metrics: the classification error rate and AUC. This can be calculated using Equation (4):  
\[\text{PC}=\left(1-\overline{\text{Error}}\right)*\overline{\text{AUC}} \tag{4}\]  
where \(\overline{\text{Error}}\) corresponds to the average error rate of all classes, and \(\overline{\text{AUC}}\) refers to the average area under the ROC curve for all obtained classes. This approach provides an overall evaluation of the model's performance that considers both its ability to distinguish between classes and its accuracy in classifying each class. By combining these two metrics, a more comprehensive assessment of performance can be obtained. It should be noted that in the definition of PC, both the error and AUC evaluate binary classification models, but they are not necessarily equally important. The error is a more critical measure for evaluating the model; it indicates how well the model is classifying observations into the correct categories. The AUC measures the model's ability to distinguish between the two classes, but it does not necessarily indicate how well observations are classified into the correct categories. In this study, both measures were considered equally significant, so equal weights were assigned. To improve the generalization ability of the models and select the best parameters, repeated cross-validation was applied. This was performed using the 'trainControl' function implemented in Caret as a common training control parameter. The purpose of this cross-validation was to repeat the process a total of five times for each model to obtain a more accurate estimate of the model performance. A total of 10 folds were specified to be used in cross-validation for each repetition of the model. At the same time, a hyperparameter grid was implemented for each model during the cross-validation training phase.