While previous linear k nearest neighbor methods have demonstrated strong generalization capability for ordinary datasets, they often fail to achieve comparable generalization capability when applied to stylistic datasets due to the unique characteristics of this type of datasets. Additionally, when multiple testing samples share a certain style characteristic, both the traditional k nearest neighbor method and evolved versions of the linear k nearest neighbor method tend to ignore the shared style in the testing sample set, leading to inefficient utilization of information resources. In order to address these issues, we propose a new classification method called Shared Style Linear kNearest Neighbor (SSL-KNN), which enhances the generalization capability of the linear k nearest neighbor method on stylistic datasets. The proposed method is motivated by the observation that one can better determine the class of a collection of homogeneous samples by evaluating their overall style, rather than simply aggregating individual sample judgments. The proposed method achieves this goal and two additional goals: a) we obtain the style membership vectors of the testing samples with different classes of the training samples in order to seek a guarantee of the generalization capability on the stylistic datasets; b) we introduce a Gaussian kernel distance metric constraining the linear expression weights in order to seek a guarantee of the generalization capability on the ordinary datasets. Furthermore, we propose an alternating optimization strategy implemented to optimize the proposed SSL-KNN method. Finally, we evaluate the proposed method and the comparative methods on 15 benchmark datasets containing both ordinary and stylistic datasets. The results show that the proposed SSL-KNN method guarantees good generalization capability on both ordinary and stylistic datasets.
Read full abstract