---
title: "Understanding k-Nearest Neighbors"
url: https://daily.dev/posts/understanding-k-nearest-neighbors-yyeet6myj
source_url: https://thepalindrome.org/p/understanding-k-nearest-neighbors
type: article
source: "The Palindrome"
published: 2024-05-09T19:40:38.174Z
updated: 2024-05-09T19:40:36.223Z
tags: ["machine-learning", "deep-learning", "classification"]
reading_time: 8
upvotes: 17
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Understanding k-Nearest Neighbors

**[The Palindrome](https://daily.dev/sources/palindrome)** · 8 min read · 17 upvotes · 0 comments

## Summary

kNN is a lazy machine learning algorithm that doesn't require training. It makes predictions by calculating distances between new samples and training samples, finding the k nearest neighbors, and classifying the new sample based on a majority vote from those neighbors. The value of 'k' is important as it determines the number of samples considered for prediction. The choice of 'k' can have a significant impact on the outcome. Different distance metrics, such as Euclidean distance, Manhattan distance, and Minkowski distance, can be used in kNN depending on the problem. Cosine similarity is another distance metric that can be useful for high-dimensional data.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://thepalindrome.org/p/understanding-k-nearest-neighbors>

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 0 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments
- [CNCF Unveils Schedule for KubeCon \+ CloudNativeCon Europe 2026](https://daily.dev/posts/cncf-unveils-schedule-for-kubecon-cloudnativecon-europe-2026-ikhcoa5cb) · CNCF · 2 upvotes · 0 comments
- [CNCF Debuts KubeCon \+ CloudNativeCon Japan 2026 Schedule](https://daily.dev/posts/cncf-debuts-kubecon-cloudnativecon-japan-2026-schedule-xp5pyudub) · CNCF · 1 upvotes · 0 comments

---

Tags: [#machine-learning](https://daily.dev/tags/machine-learning), [#deep-learning](https://daily.dev/tags/deep-learning), [#classification](https://daily.dev/tags/classification)

[View this post on daily.dev](https://daily.dev/posts/understanding-k-nearest-neighbors-yyeet6myj)
