[R] NAIVE BAYES with 10-fold cross validation
jkroepfl at gmx.net
Tue Oct 30 21:46:28 CET 2007
i am trying to implement the code of the e1071 package for naive bayes, but it doens't really work, any ideas??
i am very glad about any help!!
i need a naive bayes with 10-fold cross validation:
model <- naiveBayes(code ~ ., mydata)
tune.control <- tune.control(random = FALSE, nrepeat = 1, repeat.aggregate = min,
sampling = c("cross"), sampling.aggregate = mean,
cross = 10, best.model = TRUE, performances = TRUE)
pred <- predict(model, mydata[,-12], type="class")
tune(naiveBayes, code~., mydata, predict.fun=pred, tune.control)
thx for your help!
More information about the R-help