An Improved Local Mean-Based Distance Weighted K-Nearest Neighbor with Distance Metrics

Yujie Song, Fei Pei · 2023

The k-Nearest Neighbor (KNN) algorithm remains a pivotal tool in classification due to its simplicity and effectiveness. In this paper, a novel KNN-based classifier is introduced, termed the local mean-based distance weighted k-Nearest Neighbor algorithm (LMWKNN), which builds upon the foundation laid by the local mean-based K-nearest neighbor (LMKNN) algorithm and the distance-weighted K-nearest neighbor (WKNN) algorithm. The LMWKNN algorithm combines the advantages of LMKNN's local mean vectors and WKNN's weighted influence, aiming to enhance classification performance. In this research, the proposed LMWKNN algorithm is rigorously evaluated against five prominent distance metrics: Euclidean, Cosine, Correlation, Spearman, and Jaccard. To validate its effectiveness, extensive experiments are conducted on eight real and representative UCI datasets. The classification error rates are meticulously measured, with a focus on comparing the performance of LMWKNN across the different distance metrics. The findings reveal that the Cosine distance model yields the lowest average error rate of 26.98%, signifying the highest accuracy among the tested distance metrics. In contrast, the Jaccard model exhibits the highest average error rate of 69.04%, reflecting its comparatively weaker performance. The performance of other distance models falls within this spectrum. The comprehensive experimental results underscore the promising potential of the LMWKNN classifier in the realm of pattern recognition. Moreover, the Cosine distance model, when compared to the traditional Euclidean distance model, demonstrates better performance.

Read the paper · More papers on PaperTik