KNN acuracy doubt


here is my code
gets only 67% accuracy

Hey @Ajitverma1503, please share your ipynb notebook by uploading it on google drive and sharing the link here.

Happy Learning :sunny:

Here it is : https://drive.google.com/file/d/1n80Tkh-azOMhzlpkTwdJbvp60JGylOyJ/view?usp=sharing

Hey @Ajitverma1503, everything seems fine, try for little bit bigger values of k like k= 11, 13,15.

for 11 its 70%, for 13 its 69 and for 15 its 74

You have not made predictions on test cases file. First load test cases csv file and make predictions on that file, and not on the 20% of splitted data.

Why it is not giving good accuracy on splitted test case ?

74 is close enough, the data contains noise, so that is due to that noise only we are unable to achieve more accuracy. And test file contains little less noise than training data itself, and hence we achieved more accuracy there.

Hope this cleared your doubt. :blush:

for test cases i get 79% accuracy
Here is the file : https://drive.google.com/file/d/160Qdn6H3QSIjieEwPUZJmyytBpV3nA90/view?usp=sharing
and here is csv file : https://drive.google.com/file/d/1Ywa-qKlCHk6bEmFnpr7ULKEiZpp1cPci/view?usp=sharing

Great job done, 79% is optimum accuracy achievable with knn.

Happy Learning :blush:

but prateek bhaiya and others got 100% in this

They are the testers, they actually submitted the original solution file for testing purpose.

That means I cannot get the 100% accuracy for the testcases given in the question.

Yes, now you got it. 100% is not achievable for the question.