Dataset Ratio Influence on kNN Classification Results
摘要
Classification is used in many fields today, and for most of them machine learning algorithms can be used to make a decision. This article investigates the effects of different sizes of training and test datasets on the accuracy of classification using both classical k-nearest neighbors (kNN) and weighted k-nearest neighbors (wkNN) methods. This study systematically evaluates how different ratios of training to test data affect classification performance and provides a comprehensive analysis of the interplay between the ratios of the datasets and the parameter k. The results show that the ratio of training to test datasets exerts a more significant influence on classification accuracy than the choice of the parameter k. In particular, extreme ratios, where the training dataset is either much larger or much smaller than the test dataset, lead to suboptimal classification results. This emphasizes the importance of carefully selecting an appropriate balance between training and test data to ensure robust and reliable classification results. By highlighting the critical role of the ratio between datasets, this paper provides valuable insights for optimizing kNN and weighted kNN methods in practical applications. The results have far-reaching implications for the design and implementation of machine learning models and emphasize the need for a balanced data distribution to achieve high classification accuracy.