Regarding Accuracy of the kNN

how should I choose param K in this challenge, one possible way could be using gridsearch, but we do not have y_test labels for comparing results. i tried multiple times with different k values from 3 to 21, but accuracy score is not above 79

Hello Mohit,
K is a hyperparameter, thus its value depends upon the problem statement. You did the right thing by trying it for various value of K and that’s exactly how we do it. The value of K which gives us the best accuracy is chosen. A key point to remember though is that its value will never be very less (<5) or high (>25). The generalised optimum value will be obtained between this range only.

Also, KNN is a very primitive algorithm and is mostly used as a threshold for Training and Testing Accuracies. 79% is a fair enough (rather good) accuracy for KNN.

1 Like

Thank you, got your point

1 Like