I get an error when starting the naive gulf classifier in R. I use the following code -
mod1 <- naiveBayes(factor(X20) ~ factor(X1) + factor(X2) +factor(X3) +factor(X4)+factor(X5)+factor(X6)+factor(X7) +factor(X8)+factor(X9) +factor(X10)+factor(X11)+ factor(X12)+factor(X13)+factor(X14) +factor(X15) +factor(X16)+factor(X17) +factor(X18)+factor(X19),data=intent.test) res1 <- predict(mod1)$posterior
The first part of this code is working fine. But when he tries to predict the rear probability, he gives the following error -
**Error in as.data.frame(newdata) : argument "newdata" is missing, with no default**
I tried to run something like
res1 <- predict(mod1,new_data=intent.test)$posterior
but it also gives the same error.
source share