What is the value of K to be taken?

What is the value of K to be taken ?

hey @ritvikagrawal1 ,
the value of K depends upon dataset and various other parameters , so to find the best suitable value of k for a particular dataset , you need to iterate over various K values and select the one which performs best.

I hope this would resolved your doubt.
Thank You and Happy Learning :slightly_smiling_face:.

You mean kind of cross-validation ?

No.
In cross validation you just bootstrap your data into different subsets , but in above way as i said ,you need test your model performance on various different values of K , like what the model performance on k =1,3,5,7,9 …
just assume that , you achieve best accuracy on K=11. So just choose this value of K for your final predictions.

In this way you are not dividing your data into many other subsets , but instead use all this same data on various different values of K.

I hope this might have resolved your doubt.
Thank You and Happy Learning :slightly_smiling_face: .