MOA 12.03
Real Time Analytics for Data Streams
moa.classifiers.bayes.NaiveBayes Class Reference

Naive Bayes incremental learner. More...

Inheritance diagram for moa.classifiers.bayes.NaiveBayes:
Collaboration diagram for moa.classifiers.bayes.NaiveBayes:

List of all members.

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

Detailed Description

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:

  • -r : Seed for random behaviour of the classifier
Author:
Richard Kirkby (rkirkby@cs.waikato.ac.nz)
Version:
Revision:
7

Definition at line 47 of file NaiveBayes.java.


Member Function Documentation

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().

Here is the call graph for this function:

Here is the caller graph for this function:

void moa.classifiers.bayes.NaiveBayes.getModelDescription ( StringBuilder  out,
int  indent 
) [virtual]

Returns a string representation of the model.

Parameters:
outthe stringbuilder to add the description
indentthe number of characters to indent

Implements moa.classifiers.AbstractClassifier.

Definition at line 93 of file NaiveBayes.java.

Here is the call graph for this function:

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.

Returns:
an array of measurements to be used in evaluation tasks

Implements moa.classifiers.AbstractClassifier.

Definition at line 88 of file NaiveBayes.java.

String moa.classifiers.bayes.NaiveBayes.getPurposeString ( )

Gets the purpose of this object.

Returns:
the string with 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.

Parameters:
instthe instance to be classified
Returns:
an array containing the estimated membership probabilities of the test instance in each class

Implements moa.classifiers.Classifier.

Definition at line 82 of file NaiveBayes.java.

Here is the call graph for this function:

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.

Returns:
true if the classifier needs a random seed.

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().

Here is the caller graph for this function:

AttributeClassObserver moa.classifiers.bayes.NaiveBayes.newNumericClassObserver ( ) [protected]

Definition at line 127 of file NaiveBayes.java.

Referenced by moa.classifiers.bayes.NaiveBayes.trainOnInstanceImpl().

Here is the caller graph for this function:

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.

Parameters:
instthe instance to be used for training

Implements moa.classifiers.AbstractClassifier.

Definition at line 67 of file NaiveBayes.java.

Here is the call graph for this function:


Member Data Documentation


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations