K-nearest neighbour

I didn’t understand, why k=5 is selected in this mission.

https://app.dataquest.io/m/139/introduction-to-k-nearest-neighbors/6/randomizing-and-sorting

“This means the 5 “nearest neighbors” we select after sorting all will have a distance value of 0.”

1 Like

Hey, Waqas.

In the third screen we read the following.

We’ll use a k value of 5 in this mission. In later missions, we’ll learn how to evaluate how good the suggested prices are, how to choose the optimal k value, and more.

While the choice of the number of neighbors is very much relevant to optimize the model, it’s not relevant to start to understand how it works. We need to start somewhere, there’s nothing special about five here.

3 Likes