Re: [R] Extract naiveBayes details

From: David Meyer <david.meyer_at_wu-wien.ac.at>
Date: Fri, 27 Jun 2008 09:55:09 +0200


Stephan:

the Naive Bayes model consists of several tables, one for each
(categorical) predictor. Using

m = naiveBayes( ... )
m$tables

you will get (as the help page says):

tables: A list of tables, one for each predictor variable. For each

           categorical variable a table giving, for each attribute
           level, the conditional probabilities given the target class.

Best
David


I just like to know how to extract details from the naiveBayes model
(package e1071). I mean, for each possible value the model defines how much
it influences the outcome. I want to sort those probabilities and show the values with the highest impact.
How could I do that?

PS: I tried using []'s to get to the model's internals, however, all I get is a "list" not a "matrix" I could work with. What am I doing wrong?



R-help_at_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. Received on Fri 27 Jun 2008 - 08:00:10 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 27 Jun 2008 - 08:31:25 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive