Guilherme Ferraz de Arruda
2013-Apr-14 22:48 UTC
[R] Cross validation for Naive Bayes and Bayes Networks
Hi, I need to classify, using Naive Bayes and Bayes Networks, and estimate their performance using cross validation. How can I do this? I tried the bnlearn package for Bayes Networks, althought I need to get more indexes, not only the error rate (precision, sensitivity, ...). I also tried the *e1071* package, but I could not find a way to do cross-validation. Thanks for everyone. Guilherme. [[alternative HTML version deleted]]
Guilherme Ferraz de Arruda
2013-Apr-14 23:23 UTC
[R] Fwd: Cross validation for Naive Bayes and Bayes Networks
Hi, I need to classify, using Naive Bayes and Bayes Networks, and estimate their performance using cross validation. How can I do this? I tried the bnlearn package for Bayes Networks, althought I need to get more indexes, not only the error rate (precision, sensitivity, ...). I also tried the *e1071* package, but I could not find a way to do cross-validation. Thanks for everyone. Guilherme. [[alternative HTML version deleted]]
Marco Scutari
2013-Apr-15 13:45 UTC
[R] Cross validation for Naive Bayes and Bayes Networks
Hi Guilherme, On Sun, Apr 14, 2013 at 11:48 PM, Guilherme Ferraz de Arruda <guiep at yahoo.com.br> wrote:> Hi, > I need to classify, using Naive Bayes and Bayes Networks, and estimate > their performance using cross validation. > How can I do this? > I tried the bnlearn package for Bayes Networks, althought I need to get > more indexes, not only the error rate (precision, sensitivity, ...).You can do that using the object returned by bn.cv(), because it contains the predicted values and the indexes of the corresponding observations in the original data, for each fold. It's just a matter to reassemble observed and predicted class labels and compute your metrics.> I also tried the *e1071* package, but I could not find a way to do > cross-validation.You might be able to trick the tune() function to do it, but I am not sure. Marco -- Marco Scutari, Ph.D. Research Associate, Genetics Institute (UGI) University College London (UCL), United Kingdom