Class NaiveBayesClassifierEx3
Trains a classifier with a user supplied probability function.
This example is similar to NaiveBayesClassifierEx1, where we train a
classifier on Fisher's Iris data using 140 of the 150 continuous patterns,
and then classify ten remaining plants using their sepal and petal
measurements.
Instead of using the NormalDistribution class, a user supplied
normal (Gaussian) distribution is supplied directly. Rather than calculating
the means and standard deviations from the data, as is done by the
NormalDistribution's eval(double[]) method, the
user supplied class requires the means and standard deviations in the class
constructor. The output is the same as in NaiveBayesClassifierEx1,
since the means and standard deviations in this example are simply rounded
means and standard deviations of the actual data subset by target
classifications.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDefines the user supplied probability distribution. -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
NaiveBayesClassifierEx3
public NaiveBayesClassifierEx3()
-
-
Method Details
-
main
The main method for the example.- Throws:
Exception
-