Re: [R] Extract naiveBayes details

From: David Meyer <>
Date: Fri, 27 Jun 2008 09:55:09 +0200


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

m = naiveBayes( ... )

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.


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? mailing list PLEASE do read the posting guide 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 Please read the posting guide before posting to the list.

list of date sections of archive