Introduction to K-nearest neighbour algorithm using Sklear
1–9 of 9 posts
Re: Introduction to K-nearest neighbour algorithm using Sklear
#2Re: Introduction to K-nearest neighbour algorithm using Sklear
#3Finding nearest neighbors isn't an algorithm, it is a goal. There are many different algorithms to accomplish that. This is more about what certain functions do in python.
Re: Introduction to K-nearest neighbour algorithm using Sklear
#4Finding nearest neighbors isn't an algorithm, it is a goal. There are many different algorithms to accomplish that. This is more about what certain functions do in python.
Not sure where in the post you felt that the finding nearest neighbour is considered as an algorithm. Couldn't agree with you less, anyway.
The first sentence is "KNN also known as K-nearest neighbor is a supervised and pattern classification learning algorithm"
If someone said 'the triangle rendering algorithm' they would be asked 'which triangle rendering algorithm'.
Re: Introduction to K-nearest neighbour algorithm using Sklear
#5Re: Introduction to K-nearest neighbour algorithm using Sklear
#6Re: Introduction to K-nearest neighbour algorithm using Sklear
#7This reads weird. Either this is transcribed lecture notes, or the author is not that fluent an English speaker. Either way, I think somone unfamiliar with KNN would struggle to learn anything from this.
The probabilistic interpretation is odd, since it can only produce a few (maybe even one!) distinct values.
$k$ should probably be chosen to avoid ties (e.g., odd for a two-class problem) so you always get exactly one answer, and you should definitely chose $k$ using different data than you use to evaluate the model (e.g., validation set or inside a cross-validation loop).
Re: Introduction to K-nearest neighbour algorithm using Sklear
#8Finding nearest neighbors isn't an algorithm, it is a goal. There are many different algorithms to accomplish that. This is more about what certain functions do in python.
You are absolutely right that there are many ways to efficiently find those neighbors, but the classification algorithm itself doesn’t care; it’s implementation detail.
Re: Introduction to K-nearest neighbour algorithm using Sklear
#9> It first identifies the k points in the training data that are closest to the test value and calculates the distance between all those categories. The test value will belong to the category whose distance is the least.
There is no distance measure in deciding a category. The distance measure is used to find the N nearest neighbors. Once those neighbors are found, the class of the new data point is assigned based on the relative number of entities of each class in the N neighbor set (always taken as the most common class in the neighbor set, as far as I am aware).