Impact of k-Nearest Neighbors Parameter Tuning on Healthcare Prediction Accuracy Across Diverse Datasets
摘要
An accurate healthcare prediction is important for an effective diagnosis. Machine Learning (ML) models provide different approaches to improve predictive accuracy by analyzing complex patterns in medical data. This study presents the impact of varying k-values in the k-Nearest Neighbors (k-NN) algorithm on prediction outcomes based on four popular datasets: Parkinson′s Disease, Breast Cancer Wisconsin, Diabetes, and Heart Disease. Each dataset was preprocessed with normalization, handling of missing values, and class balancing methods. While the traditional k-NN algorithm typically considers only the values with the best accuracy, this may not always be sufficient, for example in cases of unbalanced or synthetic data cases. Other metrics like precision, recall, F1-score, and the confusion matrix can provide additional insights into model performance. By comparing these metrics, we determined if the k-value based solely on accuracy is optimal for each dataset. This evaluation involved analyzing how accuracy responds to different k-values while considering factors such as class imbalance and overfitting. This research highlights the significance of parameter tuning in ML. It demonstrates that traditional k-NN shows superior results for binary classification tasks compared to multiclass classification tasks and presents cases where slightly lower accuracy showed better performance in other metrics, such as precision and recall. However, k-NN may struggle to identify positive cases in more complex datasets.