All Packages Class Hierarchy This Package Previous Next Index WEKA's home
Class weka.classifiers.NaiveBayesSimple
java.lang.Object
|
+----weka.classifiers.Classifier
|
+----weka.classifiers.DistributionClassifier
|
+----weka.classifiers.NaiveBayesSimple
- public class NaiveBayesSimple
- extends DistributionClassifier
Class for building and using a simple Naive Bayes classifier.
Numeric attributes are modelled by a normal distribution. For more
information, see
Richard Duda and Peter Hart (1973).Pattern
Classification and Scene Analysis. Wiley, New York.
- Version:
- $Revision: 1.8 $
- Author:
- Eibe Frank (eibe@cs.waikato.ac.nz)
NaiveBayesSimple()
-
buildClassifier(Instances)
- Generates the classifier.
distributionForInstance(Instance)
- Calculates the class membership probabilities for the given test instance.
main(String[])
- Main method for testing this class.
toString()
- Returns a description of the classifier.
NaiveBayesSimple
public NaiveBayesSimple()
buildClassifier
public void buildClassifier(Instances instances) throws java.lang.Exception
Generates the classifier.
- Parameters:
instances
- set of instances serving as training data
- Throws:
- java.lang.Exception - if the classifier has not been generated successfully
- Overrides:
- buildClassifier in class Classifier
distributionForInstance
public double[] distributionForInstance(Instance instance) throws java.lang.Exception
Calculates the class membership probabilities for the given test instance.
- Parameters:
instance
- the instance to be classified
- Returns:
- predicted class probability distribution
- Throws:
- java.lang.Exception - if distribution can't be computed
- Overrides:
- distributionForInstance in class DistributionClassifier
toString
public java.lang.String toString()
Returns a description of the classifier.
- Returns:
- a description of the classifier as a string.
- Overrides:
- toString in class java.lang.Object
main
public static void main(java.lang.String argv[])
Main method for testing this class.
- Parameters:
argv
- the options
All Packages Class Hierarchy This Package Previous Next Index WEKA's home