MOA 12.03
Real Time Analytics for Data Streams
|
Naive Bayes incremental learner. More...
Public Member Functions | |
String | getPurposeString () |
Gets the purpose of this object. | |
void | resetLearningImpl () |
Resets this classifier. | |
void | trainOnInstanceImpl (Instance inst) |
Trains this classifier incrementally using the given instance. | |
double[] | getVotesForInstance (Instance inst) |
Predicts the class memberships for a given instance. | |
void | getModelDescription (StringBuilder out, int indent) |
Returns a string representation of the model. | |
boolean | isRandomizable () |
Gets whether this classifier needs a random seed. | |
void | manageMemory (int currentByteSize, int maxByteSize) |
Static Public Member Functions | |
static double[] | doNaiveBayesPrediction (Instance inst, DoubleVector observedClassDistribution, AutoExpandVector< AttributeClassObserver > attributeObservers) |
Protected Member Functions | |
Measurement[] | getModelMeasurementsImpl () |
Gets the current measurements of this classifier. | |
AttributeClassObserver | newNominalClassObserver () |
AttributeClassObserver | newNumericClassObserver () |
Protected Attributes | |
DoubleVector | observedClassDistribution |
AutoExpandVector < AttributeClassObserver > | attributeObservers |
Naive Bayes incremental learner.
Performs classic bayesian prediction while making naive assumption that all inputs are independent.
Naive Bayes is a classifier algorithm known for its simplicity and low computational cost. Given n different classes, the trained Naive Bayes classifier predicts for every unlabelled instance I the class C to which it belongs with high accuracy.
Parameters:
Definition at line 47 of file NaiveBayes.java.
static double [] moa.classifiers.bayes.NaiveBayes.doNaiveBayesPrediction | ( | Instance | inst, |
DoubleVector | observedClassDistribution, | ||
AutoExpandVector< AttributeClassObserver > | attributeObservers | ||
) | [static] |
Definition at line 131 of file NaiveBayes.java.
Referenced by moa.classifiers.bayes.NaiveBayes.getVotesForInstance().
void moa.classifiers.bayes.NaiveBayes.getModelDescription | ( | StringBuilder | out, |
int | indent | ||
) | [virtual] |
Returns a string representation of the model.
out | the stringbuilder to add the description |
indent | the number of characters to indent |
Implements moa.classifiers.AbstractClassifier.
Definition at line 93 of file NaiveBayes.java.
Measurement [] moa.classifiers.bayes.NaiveBayes.getModelMeasurementsImpl | ( | ) | [protected, virtual] |
Gets the current measurements of this classifier.
The reason for ...Impl methods: ease programmer burden by not requiring them to remember calls to super in overridden methods. Note that this will produce compiler errors if not overridden.
Implements moa.classifiers.AbstractClassifier.
Definition at line 88 of file NaiveBayes.java.
String moa.classifiers.bayes.NaiveBayes.getPurposeString | ( | ) |
Gets the purpose of this object.
Reimplemented from moa.classifiers.AbstractClassifier.
Definition at line 52 of file NaiveBayes.java.
double [] moa.classifiers.bayes.NaiveBayes.getVotesForInstance | ( | Instance | inst | ) |
Predicts the class memberships for a given instance.
If an instance is unclassified, the returned array elements must be all zero.
inst | the instance to be classified |
Implements moa.classifiers.Classifier.
Definition at line 82 of file NaiveBayes.java.
boolean moa.classifiers.bayes.NaiveBayes.isRandomizable | ( | ) |
Gets whether this classifier needs a random seed.
Examples of methods that needs a random seed are bagging and boosting.
Implements moa.classifiers.Classifier.
Definition at line 119 of file NaiveBayes.java.
void moa.classifiers.bayes.NaiveBayes.manageMemory | ( | int | currentByteSize, |
int | maxByteSize | ||
) |
Definition at line 152 of file NaiveBayes.java.
AttributeClassObserver moa.classifiers.bayes.NaiveBayes.newNominalClassObserver | ( | ) | [protected] |
Definition at line 123 of file NaiveBayes.java.
Referenced by moa.classifiers.bayes.NaiveBayes.trainOnInstanceImpl().
AttributeClassObserver moa.classifiers.bayes.NaiveBayes.newNumericClassObserver | ( | ) | [protected] |
Definition at line 127 of file NaiveBayes.java.
Referenced by moa.classifiers.bayes.NaiveBayes.trainOnInstanceImpl().
void moa.classifiers.bayes.NaiveBayes.resetLearningImpl | ( | ) | [virtual] |
Resets this classifier.
It must be similar to starting a new classifier from scratch.
The reason for ...Impl methods: ease programmer burden by not requiring them to remember calls to super in overridden methods. Note that this will produce compiler errors if not overridden.
Implements moa.classifiers.AbstractClassifier.
Definition at line 61 of file NaiveBayes.java.
void moa.classifiers.bayes.NaiveBayes.trainOnInstanceImpl | ( | Instance | inst | ) | [virtual] |
Trains this classifier incrementally using the given instance.
The reason for ...Impl methods: ease programmer burden by not requiring them to remember calls to super in overridden methods. Note that this will produce compiler errors if not overridden.
inst | the instance to be used for training |
Implements moa.classifiers.AbstractClassifier.
Definition at line 67 of file NaiveBayes.java.
AutoExpandVector<AttributeClassObserver> moa.classifiers.bayes.NaiveBayes.attributeObservers [protected] |