Re: [R] Naive Bayes in R

2012-08-02 Thread Saeed Abu Nimeh
You can use a table to compare your predicted values and the response. Here is an example: http://www.cyclismo.org/tutorial/R/tables.html On Thu, Aug 2, 2012 at 5:52 AM, Abraham Mathew wrote: > I'm developing a naive bayes in R. I have the following data and am trying > to predict on returned (cl

[R] Naive Bayes in R

2012-08-02 Thread Abraham Mathew
I'm developing a naive bayes in R. I have the following data and am trying to predict on returned (class). dat = data.frame(home=c(0,1,1,0,0), gender=c("M","M","F","M","F"), returned=c(0,0,1,1,0)) str(dat) dat$home <- as.factor(dat$home) dat$returned <- as.factor(dat$returned) library(e1071) m