Method to compute accuracy of knn

what would be method to compute acuuracy of knn

hey @adarshsingh2k ,
get the predictions of your KNN.

then match the number of samples , which are exactly same the actual class
for example
your predictions : [1,1,1,1,2,2,3,3,3,4]
actual vlaues : [1,1,4,2,2,2,4,3,3,3]

hence , if you see , 6 values matches out of 10 .
hence your accuracy is 60%.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.