Multiclass Classification via Class-Weighted Nearest Neighbors

Justin Khim, Ziyu Xu, Shashank Singh
4/9/2020
stat.MLcs.LGmath.ST

Official code: neilzxu/weighted_knn_classification (6 stars, Python, last commit 2020-04-10).

Abstract

We study statistical properties of the k-nearest neighbors algorithm for multiclass classification, with a focus on settings where the number of classes may be large and/or classes may be highly imbalanced. In particular, we consider a variant of the k-nearest neighbor classifier with non-uniform class-weightings, for which we derive upper and minimax lower bounds on accuracy, class-weighted risk, and uniform error.

Show full abstract

Additionally, we show that uniform error bounds lead to bounds on the difference between empirical confusion matrix quantities and their population counterparts across a set of weights. As a result, we may adjust the class weights to optimize classification metrics such as F1 score or Matthew's Correlation Coefficient that are commonly used in practice, particularly in settings with imbalanced classes. We additionally provide a simple example to instantiate our bounds and numerical experiments.

View on arXivView PDF

Code Implementations(1)

Code for "Multiclass Classification via Class-Weighted Nearest Neighbors"

64Python, Jupyter NotebookApr 6, 20206 years ago

Similar Papers

Cite this paper

@article{khim2020multiclass,
  title  = {Multiclass Classification via Class-Weighted Nearest Neighbors},
  author = {Justin Khim and Ziyu Xu and Shashank Singh},
  year   = {2020},
  eprint = {2004.04715},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2004.04715}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2004.04715.svg)](https://codeofpaper.com/paper/2004.04715)

Discussion