Hallo!

I would need a code for 10-fold cross validation for the classifiers Naive 
Bayes and svm (e1071) package. Has there already been done something like that?

I tried to do it myself by applying the tune function first:

library(e1071)
tune.control <- tune.control(random =F, nrepeat=1, 
repeat.aggregate=min.,sampling=c("cross"),sampling.aggregate=mean, cross=10, 
best.model=T, performances=T)

model <- naiveBayes(code~., mydata, tune.control)
pred <- predict(model, mydata)
table(pred, mydata$code)
chisq.test(code, pred)


but I get the same results as without tuning it.

It would be great if someone could help me with this.

thx a lot, 
Juila
-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger

______________________________________________
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.

Reply via email to