The getPredictions function returns predictions for the test set. How does it determine the predicted class for each instance?
By calculating Euclidean distance to the nearest neighbor
By finding the class with the highest posterior probability using Gaussian likelihoods
By averaging all feature values and comparing with thresholds
By randomly assigning a class based on prior probabilities
This question is part of this quiz :
Naive Bayes Algorithm with Implementation