I am new to R and start to play around naive bayes algorithm. But I run into a problem which I could not figure out why: for the following sample data, the predict function (using a naive bayes model) always gives me zero length. Do you have any hints? Thanks
Here is the code: > titanic_small survived pclass 1 0 3 2 1 1 3 1 3 4 1 1 5 0 3 6 0 3 > model <- naiveBayes(survived~., data=titanic_small) > prediction <- predict(model, titanic_small[,-1]) > length(prediction) [1] 0 [[alternative HTML version deleted]]
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.