Database Reference
In-Depth Information
By classifying each instance in the mushroom dataset, we can evaluate how well the model
has done. The following code snippet will do this:
user=> (frequencies
(map #(vector (.classValue (.get shrooms %))
(.classifyInstance bayes (.get shrooms %)))
(range (.numInstances shrooms))))
{[1.0 0.0] 383, [0.0 0.0] 4173, [1.0 1.0] 3533, [0.0 1.0] 35}
Thus, it classiied approximately 95 percent of the data correctly (4173 plus 3533). It thought
that 383 poisonous mushrooms were edible and 35 edible mushrooms were poisonous. This
isn't a bad result, although we might wish that it erred on the side of caution!
There's more…
F Weka's documentation for the NaiveBayes class at http://weka.sourceforge.
net/doc.dev/weka/classifiers/bayes/NaiveBayes.html has information
about the options available
F Alexandru Nedelcu has a good introduction to Bayesian modeling and classiiers at
https://www.bionicspirit.com/blog/2012/02/09/howto-build-naive-
bayes-classifier.html
Classifying data with support vector
machines
Support vector machines (SVMs) try to divide two groups of data along a plane. An SVM inds
the plane that is the farthest from both groups. If a plane comes much closer to group B, it will
prefer a plane that is approximately an equal distance from both. SVMs have a number of nice
properties. While other clustering or classiication algorithms work well with deined clusters
of data, SVMs may work ine with data that isn't in well-deined and delineated groupings. They
are also not affected by the local minima. Algorithms such as K-Means or SOMs—which begin
from a random starting point—can get caught in solutions that aren't bad for the area around
the solution, but aren't the best for the entire space. This isn't a problem for SVMs.
Getting ready
First, we'll need these dependencies in our project.clj ile:
(defproject d-mining "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.6.0"]
[nz.ac.waikato.cms.weka/weka-dev "3.7.11"]
[nz.ac.waikato.cms.weka/LibSVM "1.0.6"]])
 
Search WWH ::




Custom Search