[Zooimage-commits] r208 - pkg/zooimage/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jun 20 10:28:27 CEST 2012


Author: kevin
Date: 2012-06-20 10:28:27 +0200 (Wed, 20 Jun 2012)
New Revision: 208

Modified:
   pkg/zooimage/R/ZIClass.R
Log:
Add Naive Bayes algorithm from RWeka package

Modified: pkg/zooimage/R/ZIClass.R
===================================================================
--- pkg/zooimage/R/ZIClass.R	2012-06-20 08:11:51 UTC (rev 207)
+++ pkg/zooimage/R/ZIClass.R	2012-06-20 08:28:27 UTC (rev 208)
@@ -194,3 +194,13 @@
     if (missing(newdata)) newdata <- object$data
 	lvqtest(object$codebook, newdata[, object$vars[-1]])
 }
+
+### NaiveBayes from RWeka package
+NaiveBayes <- function(formula, data, ...)
+{
+    # Import algorithm from Weka
+    NB <- make_Weka_classifier("weka/classifiers/bayes/NaiveBayes")
+    # create classifier
+    res <- NB(formula, data, ...)
+    return(res)
+}



More information about the Zooimage-commits mailing list