How to specify that the model should return class labels using errorest in R

r
naive_bayes
error

#1

hello,

I am trying to solve the hand written digit recognizer problem of Kaggle.I am trying to compare the error rates of various models as below:

As can be seen for the naiveBayes model there is an error.I understand that this is happening because nb returns posterior probabilities.I am sure there is a way to specify that I want predicted class instead of prob but how do I do it in the errorest function??
Can someone please help me with this??


#2

@hackers - While predicting the class of the test data you can use** type** argument while predicting.

predict(object, newdata = newdata,type="class")

Hope this helps!

Regards,
Hinduja