Abstract. In this paper, a novel k -nearest neighbors (k NN) weighting strategy is proposed for handling the problem of class imbalance. When dealing with highly imbalanced data, a salient drawback of existing k NN algorithms is that the class with more frequent samples tends to dominate the neighborhood of a test instance in spite of distance measurements, which leads to suboptimal classification performance on the minority class. To solve this problem, we propose CCW (class confidence weights) that uses the probability of attribute values given class labels to weight prototypes in k NN. The main advantage of CCW is that it is able to correct the inherent bias to majority class in existing k NN algorithms on any distance measurement. Theoretical analysis and comprehensive experiments confirm our claims.