search for: naivebayessimple

Displaying 1 result from an estimated 1 matches for "naivebayessimple".

2007 Nov 01
1
RWeka and naiveBayes
...eka to use a NaiveBayes Classifier(the Weka version). However it crashes whenever there is a NA in the class Gender Here is the.code I have with d2 as the data frame. The first call to NB doesn't make R crash but the second call does. NB <- make_Weka_classifier("weka/classifiers/bayes/NaiveBayesSimple") d2[,64]<-d2$Gender=="M" NB(Gender~age,d2,na.action=na.exclude) #1st call d2$Gender[d2$Gender==""]<-NA valid.set<-(!is.na(d2$Gender)&(!is.na(d2$age))) NB(formula=Gender~age,data=d2[valid.set,],subset=valid.set,na.action=na.exclude) Anybody have an ide...