MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

MACHINE LEARNING

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
KNN algorithm requires
A
More time for training
B
More time for testing
C
Equal time for training and testing
D
None of the Mentioned
Explanation: 

Detailed explanation-1: -The k-NN algorithm does more computation on test time rather than train time. That is absolutely true. The idea of the kNN algorithm is to find a k-long list of samples that are close to a sample we want to classify.

Detailed explanation-2: -Advantages and disadvantages of KNN Since it’s a lazy learning algorithm and not an eager learner, there’s no need to train the model; instead, all data points are used at the time of prediction. Of course, that’s computationally expensive and time-consuming.

Detailed explanation-3: -Time Complexity: The time complexity of the kNN algorithm is O(nd); n is the total number of data-points in the training data and d is the total number of features in the dataset. All distances will be computed for a new query point.

Detailed explanation-4: -As it is nonparametric method, it uses data itself to make predictions. Parametric models make predictions fast, since they rely on a model. KNN does not have model, so prediction is very slow.

There is 1 question to complete.