MACHINE LEARNING

APPLICATION OF SUPERVISED LEARNING

MACHINE LEARNINGHARD QUESTIONS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
what will be the output of this code?acc = knn.score(X ____ test, y ____ test) ( f ‘accuracy from knn.score = {acc:.4 } ‘ ) sklearn import metrics ( f ‘accuracy from metrics.accuracy ____ score= {acc:.4 } ‘ )
A
print the accuracy and metrics accuracy
B
print the accuracy from knn and print the accuracy from metric accuracy
C
both 1 and 2
D
none of trhese
Explanation: 

Detailed explanation-1: -This is the optimal number of nearest neighbors, which in this case is 11, with a test accuracy of 90%.

Detailed explanation-2: -kNN classifier determines the class of a data point by majority voting principle. If k is set to 5, the classes of 5 closest points are checked. Prediction is done according to the majority class. Similarly, kNN regression takes the mean value of 5 closest points.

Detailed explanation-3: -KNN model. Pick a value for K. This would always have 100% accuracy, because we are testing on the exact same data, it would always make correct predictions. KNN would search for one nearest observation and find that exact same observation. KNN has memorized the training set.

There is 1 question to complete.