how optimal value of ‘k’ in knn algo can be decided through cross validation.
Optimal value of 'k' in knn algorithm
Just randomly choose values for k, say 5, 7, 10 etc, and calculate the accuracy. The value of k for which the accuracy is maximum is the optimal value of k.
Happy Learning
Thanks.