MOA 12.03
Real Time Analytics for Data Streams
moa.classifiers.Classifier Interface Reference

Classifier interface for incremental classification models. More...

Inheritance diagram for moa.classifiers.Classifier:
Collaboration diagram for moa.classifiers.Classifier:

List of all members.

Public Member Functions

void setModelContext (InstancesHeader ih)
 Sets the reference to the header of the data stream.
InstancesHeader getModelContext ()
 Gets the reference to the header of the data stream.
boolean isRandomizable ()
 Gets whether this classifier needs a random seed.
void setRandomSeed (int s)
 Sets the seed for random number generation.
boolean trainingHasStarted ()
 Gets whether training has started.
double trainingWeightSeenByModel ()
 Gets the sum of the weights of the instances that have been used by this classifier during the training in trainOnInstance
void resetLearning ()
 Resets this classifier.
void trainOnInstance (Instance inst)
 Trains this classifier incrementally using the given instance.
double[] getVotesForInstance (Instance inst)
 Predicts the class memberships for a given instance.
boolean correctlyClassifies (Instance inst)
 Gets whether this classifier correctly classifies an instance.
Measurement[] getModelMeasurements ()
 Gets the current measurements of this classifier.
Classifier[] getSubClassifiers ()
 Gets the classifiers of this ensemble.
Classifier copy ()
 Produces a copy of this classifier.

Detailed Description

Classifier interface for incremental classification models.

Author:
Richard Kirkby (rkirkby@cs.waikato.ac.nz)
Version:
Revision:
7

Definition at line 35 of file Classifier.java.


Member Function Documentation

boolean moa.classifiers.Classifier.correctlyClassifies ( Instance  inst)

Gets whether this classifier correctly classifies an instance.

Uses getVotesForInstance to obtain the prediction and the instance to obtain its true class.

Parameters:
instthe instance to be classified
Returns:
true if the instance is correctly classified

Implemented in moa.classifiers.AbstractClassifier.

Referenced by moa.classifiers.meta.OzaBoostAdwin.trainOnInstanceImpl(), moa.classifiers.meta.OzaBagAdwin.trainOnInstanceImpl(), moa.classifiers.meta.LimAttClassifier.trainOnInstanceImpl(), and moa.classifiers.meta.LeveragingBag.trainOnInstanceImpl().

Here is the caller graph for this function:

InstancesHeader moa.classifiers.Classifier.getModelContext ( )

Gets the reference to the header of the data stream.

The header of the data stream is extended from WEKA Instances. This header is needed to know the number of classes and attributes

Returns:
the reference to the data stream header

Implemented in moa.classifiers.AbstractClassifier.

Measurement [] moa.classifiers.Classifier.getModelMeasurements ( )

Gets the current measurements of this classifier.

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

Implemented in moa.classifiers.AbstractClassifier.

Referenced by moa.tasks.EvaluatePeriodicHeldOutTest.doMainTask(), and moa.evaluation.LearningEvaluation.LearningEvaluation().

Here is the caller graph for this function:

Classifier [] moa.classifiers.Classifier.getSubClassifiers ( )
double [] moa.classifiers.Classifier.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

Implemented in moa.classifiers.active.ActiveClassifier, moa.classifiers.bayes.NaiveBayes, moa.classifiers.bayes.NaiveBayesMultinomial, moa.classifiers.drift.SingleClassifierDrift, moa.classifiers.functions.MajorityClass, moa.classifiers.functions.Perceptron, moa.classifiers.functions.SGD, moa.classifiers.functions.SPegasos, moa.classifiers.meta.AccuracyWeightedEnsemble, moa.classifiers.meta.LeveragingBag, moa.classifiers.meta.LimAttClassifier, moa.classifiers.meta.OCBoost, moa.classifiers.meta.OzaBag, moa.classifiers.meta.OzaBagAdwin, moa.classifiers.meta.OzaBagASHT, moa.classifiers.meta.OzaBoost, moa.classifiers.meta.OzaBoostAdwin, moa.classifiers.meta.WeightedMajorityAlgorithm, moa.classifiers.meta.WEKAClassifier, moa.classifiers.trees.DecisionStump, moa.classifiers.trees.HoeffdingAdaptiveTree, moa.classifiers.trees.HoeffdingOptionTree, and moa.classifiers.trees.HoeffdingTree.

Referenced by moa.classifiers.meta.AccuracyWeightedEnsemble.computeWeight(), moa.classifiers.meta.AccuracyUpdatedEnsemble.computeWeight(), moa.classifiers.AbstractClassifier.correctlyClassifies(), weka.classifiers.meta.MOA.distributionForInstance(), moa.tasks.EvaluatePrequential.doMainTask(), moa.tasks.EvaluatePeriodicHeldOutTest.doMainTask(), moa.tasks.EvaluateModel.doMainTask(), moa.tasks.EvaluateInterleavedTestThenTrain.doMainTask(), moa.tasks.EvaluateInterleavedChunks.doMainTask(), moa.classifiers.drift.SingleClassifierDrift.getVotesForInstance(), moa.classifiers.meta.LimAttClassifier.getVotesForInstance(), moa.classifiers.active.ActiveClassifier.getVotesForInstance(), moa.classifiers.meta.OzaBoostAdwin.getVotesForInstanceBinary(), moa.classifiers.meta.LeveragingBag.getVotesForInstanceBinary(), moa.classifiers.meta.LimAttClassifier.trainOnInstanceImpl(), and moa.classifiers.active.ActiveClassifier.trainOnInstanceImpl().

Here is the caller graph for this function:

void moa.classifiers.Classifier.setModelContext ( InstancesHeader  ih)

Sets the reference to the header of the data stream.

The header of the data stream is extended from WEKA Instances. This header is needed to know the number of classes and attributes

Parameters:
ihthe reference to the data stream header

Implemented in moa.classifiers.AbstractClassifier.

Referenced by moa.tasks.LearnModel.doMainTask(), moa.tasks.EvaluatePrequential.doMainTask(), moa.tasks.EvaluatePeriodicHeldOutTest.doMainTask(), moa.tasks.EvaluateInterleavedTestThenTrain.doMainTask(), and moa.tasks.EvaluateInterleavedChunks.doMainTask().

Here is the caller graph for this function:

void moa.classifiers.Classifier.setRandomSeed ( int  s)

Sets the seed for random number generation.

Parameters:
sthe seed

Implemented in moa.classifiers.AbstractClassifier.

boolean moa.classifiers.Classifier.trainingHasStarted ( )

Gets whether training has started.

Returns:
true if training has started

Implemented in moa.classifiers.AbstractClassifier.

double moa.classifiers.Classifier.trainingWeightSeenByModel ( )

Gets the sum of the weights of the instances that have been used by this classifier during the training in trainOnInstance

Returns:
the weight of the instances that have been used training

Implemented in moa.classifiers.AbstractClassifier.


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