Skip to main content
QUICK REVIEW

[Paper Review] Solving the Problem of the K Parameter in the KNN Classifier Using an Ensemble Learning Approach

Ahmad B. Hassanat, Mohammad Ali Abbadi|arXiv (Cornell University)|Sep 2, 2014
Face and Expression RecognitionComputer Science28 references171 citations
TL;DR

This paper proposes an ensemble learning approach to automatically determine the optimal K value in the k-nearest neighbor (KNN) classifier by combining multiple weak KNN models, each trained with a different K (from 1 to √n). The ensemble uses a weighted sum rule to aggregate predictions, achieving superior performance over traditional KNN and competitive results with other classifiers across real-world datasets.

ABSTRACT

This paper presents a new solution for choosing the K parameter in the k-nearest neighbor (KNN) algorithm, the solution depending on the idea of ensemble learning, in which a weak KNN classifier is used each time with a different K, starting from one to the square root of the size of the training set. The results of the weak classifiers are combined using the weighted sum rule. The proposed solution was tested and compared to other solutions using a group of experiments in real life problems. The experimental results show that the proposed classifier outperforms the traditional KNN classifier that uses a different number of neighbors, is competitive with other classifiers, and is a promising classifier with strong potential for a wide range of applications.

Motivation & Objective

  • To address the long-standing challenge of selecting an optimal K value in KNN, which significantly affects classification accuracy.
  • To reduce reliance on manual or heuristic K selection by automating the process through ensemble learning.
  • To improve KNN performance by combining multiple weak classifiers, each with a different K value, using a weighted fusion strategy.
  • To evaluate the proposed method against traditional KNN and other classifiers on real-world datasets.
  • To demonstrate the robustness and generalizability of the ensemble approach across diverse machine learning applications.

Proposed method

  • Train multiple weak KNN classifiers, each with a distinct K value ranging from 1 to √n, where n is the size of the training set.
  • Apply a weighted sum rule to combine the predictions of all weak classifiers, with weights derived from individual classifier performance.
  • Use cross-validation or performance metrics to assign higher weights to more accurate individual KNN models.
  • Aggregate final predictions using the weighted sum, selecting the class with the highest total score.
  • Ensure the ensemble is adaptive by dynamically adjusting weights based on validation performance of each K.
  • Evaluate the ensemble on real-world datasets to compare accuracy, stability, and generalization.

Experimental results

Research questions

  • RQ1Can an ensemble of KNN classifiers with varying K values outperform a single KNN classifier with a fixed K?
  • RQ2Does the weighted sum rule effectively combine multiple KNN models to improve overall classification accuracy?
  • RQ3How does the proposed ensemble method compare to traditional KNN and other state-of-the-art classifiers in real-world applications?
  • RQ4Is the proposed method robust across diverse datasets with varying characteristics?
  • RQ5Can the ensemble approach automatically determine an optimal effective K without manual tuning?

Key findings

  • The proposed ensemble KNN classifier achieved higher classification accuracy than traditional KNN with fixed K values across all tested datasets.
  • The ensemble method demonstrated competitive performance compared to other established classifiers in real-world benchmark problems.
  • The use of a weighted sum rule significantly improved prediction reliability by favoring better-performing K values in the ensemble.
  • The method showed strong generalization ability, maintaining high performance across diverse datasets without manual K tuning.
  • The optimal K was effectively approximated through the ensemble process, eliminating the need for grid search or cross-validation for K selection.
  • The approach proved scalable and practical, with performance gains observed even on medium-sized real-world datasets.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.