## 3 Materials and Methods
### Model Training and Evaluation  
These predictive models were implemented in the Python programming language using ML libraries. The Pandas library (version 1.5.3) was used for data manipulation and analysis, and Numpy (version 1.23.5) was employed for numerical calculations. For data visualization, Matplotlib (version 3.7.1) and Seaborn (version 0.12.2) were utilized. Interactive visualizations were created with Plotly (version 5.15.0), utilizing the Plotly.express module and the Plotly.io interface. After processing the dataset, it was used to train NNs with four ML models (KNN with \(k\) values of 2 (KNN2) and 3 (KNN3), LR, and RF) utilizing Scikit-learn and Keras. The typical values for \(k\) in KNN are 2 or 3, but there is no unique, well-established strategy for determining the best \(k\) value [38]. We conducted experiments with a higher number of integers for K, but only values of 2 and 3 achieved notable results. For the undersampling methods, the most relevant parameters were the _sampling_strategy_ (how many instances to sample for all methods), _random_state_ (seed for random number generation like in a CNN), _n_neighbours_ (number of neighbors to consider), and _max_iter_ (limits the number of iterations), _threshold_cleaning_ (decides which instance to keep). Oversampling methods include important parameters such as _k_neighbors_ (number of nearest neighbors to use for synthetic sample generation for SVM and Borderline), _m_neighbours_ (defining the number of neighbors to consider for SVM), and _n_jobs_ (number of processors to use for parallel processing like in ADASYN). The values of the algorithms were selected based on the size of the data and class imbalance. Using guidelines established in [18] and empirical testing also improved model performance. To measure model performance, we used a common ML approach where the data were split into a 75% training set and a 25% testing set. When evaluating models for the diagnosis of contagious diseases, such as sexually transmitted infections, which are a primary risk factor for cervical cancer, the selected metrics must align with the goals of diagnosis. In this case, identifying all the infected individuals (even at the risk of some false positives) is more critical than missing infected persons. In order to measure this imbalanced data learning, the following five evaluation metrics were selected as performance evaluation criteria: Accuracy (%) (A4), Precision (%) (A5), Recall (%) (A6), F1 Score (%) (A7), Balanced Accuracy (%) (Ba Accuracy) (A8) ROC_AUC score (%) [39], Class distribution (Majority (MajClass) or Minority Class (MinClass)), and Number of instances [40]. The confusion matrix presented in Table 1 represents the obtained classification results. Correctly classified instances are True Positive (TP) and True Negative (TN), and incorrectly classified instances are False Positive (FP) and False Negative (FN) [41]. The ROC curve and the corresponding AUC illustrate how well the model is capable of distinguishing between classes. The higher the AUC value, the more likely the model is to distinguish class 1 as 1 and class 0 as 0 (class 1 denotes cervical cancer; class 0 denotes cervical cancer not identified). To calculate it, a classifier and the probabilities obtained from predictions are needed. With multiple thresholds and based on each threshold, it can categorize the predicted probabilities as false or true and calculate the true-positive rate and false-positive rate. An AUC closer to 1 indicates a better measure of separability, as well as which threshold is most suitable for a classifier, while the ROC curve is a probability curve. The X axis indicates the false-positive rate, and the Y axis represents the true-positive rate. Each point on the curve represents a probability threshold used to determine whether an example belongs to a certain category. Metrics such as accuracy, F1 Score, and recall, both weighted and macro forms were also calculated to address the impact of imbalance.