|
DATA MINING
Desktop Survival Guide by Graham Williams |
|
|||
|
Use Weka:
## Create an interface to Weka's Naive Bayes classifier.
NB <- make_Weka_classifier("weka/classifiers/bayes/NaiveBayes")
## Note that this has a very useful print method:
NB
## And we can use the Weka Option Wizard for finding out more:
WOW(NB)
## And actually use the interface ...
if(require("e1071", quietly = TRUE) &&
require("mlbench", quietly = TRUE)) {
data("HouseVotes84", package = "mlbench")
model <- NB(Class ~ ., data = HouseVotes84)
predict(model, HouseVotes84[1:10, -1])
predict(model, HouseVotes84[1:10, -1], type = "prob")
}
## (Compare this to David Meyer's naiveBayes() in package 'e1071'.)
|
Todo: UNDER CONSTRUCTION