| java.lang.Object weka.classifiers.Classifier weka.classifiers.bayes.NaiveBayesSimple
NaiveBayesSimple | public class NaiveBayesSimple extends Classifier implements TechnicalInformationHandler(Code) | |
Class for building and using a simple Naive Bayes classifier.Numeric attributes are modelled by a normal distribution.
For more information, see
Richard Duda, Peter Hart (1973). Pattern Classification and Scene Analysis. Wiley, New York.
BibTeX:
@book{Duda1973,
address = {New York},
author = {Richard Duda and Peter Hart},
publisher = {Wiley},
title = {Pattern Classification and Scene Analysis},
year = {1973}
}
Valid options are:
-D
If set, classifier is run in debug mode and
may output additional info to the console
author: Eibe Frank (eibe@cs.waikato.ac.nz) version: $Revision: 1.19 $ |
Field Summary | |
protected static double | NORM_CONST Constant for normal distribution. | protected double[][][] | m_Counts All the counts for nominal attributes. | protected double[][] | m_Devs The standard deviations for numeric attributes. | protected Instances | m_Instances The instances used for training. | protected double[][] | m_Means The means for numeric attributes. | protected double[] | m_Priors The prior probabilities of the classes. | final static long | serialVersionUID |
NORM_CONST | protected static double NORM_CONST(Code) | | Constant for normal distribution.
|
m_Counts | protected double[][][] m_Counts(Code) | | All the counts for nominal attributes.
|
m_Devs | protected double[][] m_Devs(Code) | | The standard deviations for numeric attributes.
|
m_Instances | protected Instances m_Instances(Code) | | The instances used for training.
|
m_Means | protected double[][] m_Means(Code) | | The means for numeric attributes.
|
m_Priors | protected double[] m_Priors(Code) | | The prior probabilities of the classes.
|
serialVersionUID | final static long serialVersionUID(Code) | | for serialization
|
buildClassifier | public void buildClassifier(Instances instances) throws Exception(Code) | | Generates the classifier.
Parameters: instances - set of instances serving as training data exception: Exception - if the classifier has not been generated successfully |
distributionForInstance | public double[] distributionForInstance(Instance instance) throws Exception(Code) | | Calculates the class membership probabilities for the given test instance.
Parameters: instance - the instance to be classified predicted class probability distribution exception: Exception - if distribution can't be computed |
getCapabilities | public Capabilities getCapabilities()(Code) | | Returns default capabilities of the classifier.
the capabilities of this classifier |
getTechnicalInformation | public TechnicalInformation getTechnicalInformation()(Code) | | Returns an instance of a TechnicalInformation object, containing
detailed information about the technical background of this class,
e.g., paper reference or book this class is based on.
the technical information about this class |
globalInfo | public String globalInfo()(Code) | | Returns a string describing this classifier
a description of the classifier suitable fordisplaying in the explorer/experimenter gui |
main | public static void main(String[] argv)(Code) | | Main method for testing this class.
Parameters: argv - the options |
normalDens | protected double normalDens(double x, double mean, double stdDev)(Code) | | Density function of normal distribution.
Parameters: x - the value to get the density for Parameters: mean - the mean Parameters: stdDev - the standard deviation the density |
toString | public String toString()(Code) | | Returns a description of the classifier.
a description of the classifier as a string. |
Fields inherited from weka.classifiers.Classifier | protected boolean m_Debug(Code)(Java Doc)
|
|
|