Re: [R] Cross validation for Naive Bayes and Bayes Networks

2013-04-15 Thread Marco Scutari
Hi Guilherme,

On Sun, Apr 14, 2013 at 11:48 PM, Guilherme Ferraz de Arruda
 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

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


[R] Cross validation for Naive Bayes and Bayes Networks

2013-04-14 Thread Guilherme Ferraz de Arruda
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]]

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