Quiz Questions doubt

Can you explain the answers to Question1 and question6?
Why the value of K can’t be even?

hey @Mohit2000,
Can you please let me know what questions are you talking about ,
This portal shows questions to us in random order , hence it is a bit of confusion to us.

Thank You :slightly_smiling_face:.

  1. k-NN is a memory-based approach is that the classifier immediately adapts as we collect new training data. 2. The computational complexity for classifying new samples grows linearly with the number of samples in the training dataset in the worst-case scenario. 3. We can choose optimal value of k with the help of cross validation. 4. Euclidean distance treats each feature as equally important. I want clarity about these statements and want to know why the value of K in knn can’t be even?

Just imagine you have a very big dataset for KNN , so to maintain its working on new data , it need to keep all the information in memory and hence requires more memory as the data increases.

KNN depends a lot upon both data quality and quantity . So if the data values are very big and the number of records provided are also very large then KNN will require to make a hell lot of calculations indeed requiring high complexity power.

Yes ofcourse , you can just provide a large number of values for K and run a cross validation using gridsearchCV to check which one works the best.

Yes its true. Euclidean distance doesn’t understand which feature whether it is far or near is more useful or not.

It is not as such that you can’t use values of K to be even , to do that you need to make changes in your code.
and also if the value is even , you can get stuck at a point when you will get predictions to be of equal weightage and then at that time you wont be able to judge to classify the given point in which class.
hence , we choose odd values for K.

I hope this all might have been helpful to you.

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.