Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upIncorrect number of predictions when using single record with naive bayes #345
Comments
|
The data were coming into the prediction function as a matrix and was getting converted to the wrong format. I've made a change to fix this. |
I encountered a question on SO. I reproduced the encountered error in the code below.
When you use the naive bayes method with caret and then use predict on one record, you get more predictions returned than just one. Strangely enough it only happens with the formula notation, and only with prediction type = "raw". With type = "prob" it works correctly. I also tested it with different methods, but for now it only happens with hte naive bayes method. Directly using the KlaR package works as expected.