{"url":"/method/k-nn","slug":"k-nn","name":"k-NN","full_name":"k-Nearest Neighbors","full_name_withheld":false,"description_markdown":"**$k$-Nearest Neighbors** is a clustering-based algorithm for classification and regression. It is a a type of instance-based learning as it does not attempt to construct a general internal model, but simply stores instances of the training data. Prediction is computed from a simple majority vote of the nearest neighbors of each point: a query point is assigned the data class which has the most representatives within the nearest neighbors of the point.\r\n\r\nSource of Description and Image: [scikit-learn](https://scikit-learn.org/stable/modules/neighbors.html#classification)","description_state":"present","introduced_year":null,"introduced_by":{"title":null,"paper":null,"first_author":null,"n_authors":0,"url_abs":null,"archive_paper_url":null},"source":{"url":null,"title":null,"url_on_a_paper_host":false},"code_snippet_url":null,"code_snippet_url_on_a_code_host":false,"categories":[{"area":"General","area_id":"general","collection":"Non-Parametric Regression","url":"/methods/category/non-parametric-regression","pwc_aliases":[]},{"area":"General","area_id":"general","collection":"Non-Parametric Classification","url":"/methods/category/non-parametric-classification","pwc_aliases":[]}],"n_papers_tagged":192,"archive_num_papers":192,"papers_newest_first":[{"paper":null,"title":"Feature-Guided Neighbor Selection for Non-Expert Evaluation of Model Predictions","date":"2025-07-08","arxiv_id":"2507.06029","n_code_links":0,"syntology":null},{"paper":null,"title":"When Simple Model Just Works: Is Network Traffic Classification in Crisis?","date":"2025-06-10","arxiv_id":"2506.08655","n_code_links":0,"syntology":null},{"paper":"/paper/nearness-of-neighbors-attention-for","title":"Nearness of Neighbors Attention for Regression in Supervised Finetuning","date":"2025-06-09","arxiv_id":"2506.08139","n_code_links":1,"syntology":null},{"paper":"/paper/general-feature-extraction-in-sar-target","title":"General Feature Extraction In SAR Target Classification: A Contrastive Learning Approach Across Sensor Types","date":"2025-02-03","arxiv_id":"2502.01162","n_code_links":1,"syntology":null},{"paper":"/paper/killing-it-with-zero-shot-adversarially","title":"Killing it with Zero-Shot: Adversarially Robust Novelty Detection","date":"2025-01-25","arxiv_id":"2501.15271","n_code_links":1,"syntology":null},{"paper":null,"title":"Practical machine learning is learning on small samples","date":"2025-01-03","arxiv_id":"2501.01836","n_code_links":0,"syntology":null},{"paper":null,"title":"Sound Classification of Four Insect Classes","date":"2024-12-16","arxiv_id":"2412.12395","n_code_links":0,"syntology":null},{"paper":null,"title":"WaKA: Data Attribution using K-Nearest Neighbors and Membership Privacy Principles","date":"2024-11-02","arxiv_id":"2411.01357","n_code_links":0,"syntology":null},{"paper":null,"title":"KNN Transformer with Pyramid Prompts for Few-Shot Learning","date":"2024-10-14","arxiv_id":"2410.10227","n_code_links":0,"syntology":null},{"paper":null,"title":"Improving Numerical Stability of Normalized Mutual Information Estimator on High Dimensions","date":"2024-10-10","arxiv_id":"2410.07642","n_code_links":0,"syntology":null},{"paper":null,"title":"Local-to-Global Self-Supervised Representation Learning for Diabetic Retinopathy Grading","date":"2024-10-01","arxiv_id":"2410.00779","n_code_links":0,"syntology":null},{"paper":null,"title":"Enriched Functional Tree-Based Classifiers: A Novel Approach Leveraging Derivatives and Geometric Features","date":"2024-09-26","arxiv_id":"2409.17804","n_code_links":0,"syntology":null},{"paper":null,"title":"Pushing the Limits of Vision-Language Models in Remote Sensing without Human Annotations","date":"2024-09-11","arxiv_id":"2409.07048","n_code_links":0,"syntology":null},{"paper":"/paper/optimizing-clip-models-for-image-retrieval","title":"Optimizing CLIP Models for Image Retrieval with Maintained Joint-Embedding Alignment","date":"2024-09-03","arxiv_id":"2409.01936","n_code_links":1,"syntology":{"ran":5,"of":14,"unverified":9,"pointer_only":0}},{"paper":"/paper/unsupervised-transfer-learning-via","title":"Unsupervised Transfer Learning via Adversarial Contrastive Training","date":"2024-08-16","arxiv_id":"2408.08533","n_code_links":0,"syntology":{"ran":2,"of":6,"unverified":4,"pointer_only":0}},{"paper":"/paper/cnn-jepa-self-supervised-pretraining","title":"CNN-JEPA: Self-Supervised Pretraining Convolutional Neural Networks Using Joint Embedding Predictive Architecture","date":"2024-08-14","arxiv_id":"2408.07514","n_code_links":1,"syntology":null},{"paper":"/paper/whitening-consistently-improves-self","title":"Whitening Consistently Improves Self-Supervised Learning","date":"2024-08-14","arxiv_id":"2408.07519","n_code_links":1,"syntology":{"ran":1,"of":2,"unverified":1,"pointer_only":0}},{"paper":"/paper/guiding-sentiment-analysis-with-hierarchical","title":"Guiding Sentiment Analysis with Hierarchical Text Clustering: Analyzing the German X/Twitter Discourse on Face Masks in the 2020 COVID-19 Pandemic","date":"2024-08-01","arxiv_id":null,"n_code_links":1,"syntology":null},{"paper":"/paper/oaml-outlier-aware-metric-learning-for-ood","title":"Enhancing OOD Detection Using Latent Diffusion","date":"2024-06-24","arxiv_id":"2406.16525","n_code_links":1,"syntology":null},{"paper":null,"title":"Learning from String Sequences","date":"2024-05-10","arxiv_id":"2405.06301","n_code_links":0,"syntology":null},{"paper":null,"title":"Adaptive Retrieval and Scalable Indexing for k-NN Search with Cross-Encoders","date":"2024-05-06","arxiv_id":"2405.03651","n_code_links":0,"syntology":null},{"paper":"/paper/long-tail-image-generation-through-feature","title":"Long Tail Image Generation Through Feature Space Augmentation and Iterated Learning","date":"2024-05-02","arxiv_id":"2405.01705","n_code_links":1,"syntology":null},{"paper":null,"title":"GLCM-Based Feature Combination for Extraction Model Optimization in Object Detection Using Machine Learning","date":"2024-04-06","arxiv_id":"2404.04578","n_code_links":0,"syntology":null},{"paper":"/paper/glc-source-free-universal-domain-adaptation","title":"GLC++: Source-Free Universal Domain Adaptation through Global-Local Clustering and Contrastive Affinity Learning","date":"2024-03-21","arxiv_id":"2403.14410","n_code_links":2,"syntology":null},{"paper":"/paper/a-generative-approach-for-wikipedia-scale","title":"A Generative Approach for Wikipedia-Scale Visual Entity Recognition","date":"2024-03-04","arxiv_id":"2403.02041","n_code_links":2,"syntology":null},{"paper":null,"title":"Attention-Guided Masked Autoencoders For Learning Image Representations","date":"2024-02-23","arxiv_id":"2402.15172","n_code_links":0,"syntology":null},{"paper":null,"title":"Learning with Structural Labels for Learning with Noisy Labels","date":"2024-01-01","arxiv_id":null,"n_code_links":0,"syntology":null},{"paper":null,"title":"Analyzing Local Representations of Self-supervised Vision Transformers","date":"2023-12-31","arxiv_id":"2401.00463","n_code_links":0,"syntology":null},{"paper":null,"title":"Improving Collaborative Filtering Recommendation via Graph Learning","date":"2023-11-06","arxiv_id":"2311.03316","n_code_links":0,"syntology":null},{"paper":"/paper/llmaaa-making-large-language-models-as-active","title":"LLMaAA: Making Large Language Models as Active Annotators","date":"2023-10-30","arxiv_id":"2310.19596","n_code_links":1,"syntology":{"ran":3,"of":3,"unverified":0,"pointer_only":3}}],"papers_shown":30,"tasks":[{"task":"/task/clustering","name":"Clustering","papers":27},{"task":"/task/retrieval","name":"Retrieval","papers":24},{"task":"/task/classification","name":"General Classification","papers":20},{"task":"/task/classification-1","name":"Classification","papers":17},{"task":"/task/self-supervised-learning","name":"Self-Supervised Learning","papers":11},{"task":"/task/machine-learning","name":"BIG-bench Machine Learning","papers":9},{"task":"/task/dimensionality-reduction","name":"Dimensionality Reduction","papers":9},{"task":"/task/image-retrieval","name":"Image Retrieval","papers":9},{"task":"/task/graph-partitioning","name":"graph partitioning","papers":9},{"task":"/task/regression-1","name":"regression","papers":9},{"task":"/task/contrastive-learning","name":"Contrastive Learning","papers":8},{"task":"/task/graph-embedding","name":"Graph Embedding","papers":8},{"task":"/task/image-classification","name":"Image Classification","papers":8},{"task":"/task/quantization","name":"Quantization","papers":7},{"task":"/task/representation-learning","name":"Representation Learning","papers":7},{"task":"/task/sentiment-analysis","name":"Sentiment Analysis","papers":7},{"task":"/task/image-classification","name":"image-classification","papers":7},{"task":"/task/graph-clustering","name":"Graph Clustering","papers":6},{"task":"/task/metric-learning","name":"Metric Learning","papers":6},{"task":"/task/object-detection","name":"Object Detection","papers":6}],"tasks_shown":20,"n_tasks":206,"usage_by_year":[{"year":"2012","papers":3},{"year":"2013","papers":3},{"year":"2014","papers":4},{"year":"2015","papers":3},{"year":"2016","papers":9},{"year":"2017","papers":8},{"year":"2018","papers":16},{"year":"2019","papers":19},{"year":"2020","papers":17},{"year":"2021","papers":33},{"year":"2022","papers":20},{"year":"2023","papers":30},{"year":"2024","papers":21},{"year":"2025","papers":6}],"row_source":"methods_table","archive":{"source":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","archive_url":"https://paperswithcode.com/method/k-nn"},"syntology_read_at":"2026-09-24T18:15:14+00:00"}