MOA 12.03
Real Time Analytics for Data Streams
moa.classifiers.meta.WEKAClassifier Class Reference

Class for using a classifier from WEKA. More...

Inheritance diagram for moa.classifiers.meta.WEKAClassifier:
Collaboration diagram for moa.classifiers.meta.WEKAClassifier:

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.
void buildClassifier ()
double[] getVotesForInstance (Instance inst)
 Predicts the class memberships for a given instance.
boolean isRandomizable ()
 Gets whether this classifier needs a random seed.
void getModelDescription (StringBuilder out, int indent)
 Returns a string representation of the model.
void createWekaClassifier (String[] options) throws Exception

Public Attributes

WEKAClassOption baseLearnerOption
IntOption widthOption
IntOption widthInitOption
IntOption sampleFrequencyOption

Protected Member Functions

Measurement[] getModelMeasurementsImpl ()
 Gets the current measurements of this classifier.

Protected Attributes

Classifier classifier
int numberInstances
Instances instancesBuffer
boolean isClassificationEnabled
boolean isBufferStoring

Detailed Description

Class for using a classifier from WEKA.

Author:
Albert Bifet (abifet at cs dot waikato dot ac dot nz)
FracPete (fracpete at waikato dot ac dot nz)
Version:
$Revision$

Definition at line 39 of file WEKAClassifier.java.


Member Function Documentation

void moa.classifiers.meta.WEKAClassifier.buildClassifier ( )

Definition at line 148 of file WEKAClassifier.java.

Referenced by moa.classifiers.meta.WEKAClassifier.trainOnInstanceImpl().

Here is the caller graph for this function:

void moa.classifiers.meta.WEKAClassifier.createWekaClassifier ( String[]  options) throws Exception

Definition at line 196 of file WEKAClassifier.java.

Referenced by moa.classifiers.meta.WEKAClassifier.resetLearningImpl().

Here is the caller graph for this function:

void moa.classifiers.meta.WEKAClassifier.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 184 of file WEKAClassifier.java.

Measurement [] moa.classifiers.meta.WEKAClassifier.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 191 of file WEKAClassifier.java.

String moa.classifiers.meta.WEKAClassifier.getPurposeString ( )

Gets the purpose of this object.

Returns:
the string with the purpose of this object

Reimplemented from moa.classifiers.AbstractClassifier.

Definition at line 45 of file WEKAClassifier.java.

double [] moa.classifiers.meta.WEKAClassifier.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 162 of file WEKAClassifier.java.

boolean moa.classifiers.meta.WEKAClassifier.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 179 of file WEKAClassifier.java.

void moa.classifiers.meta.WEKAClassifier.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 74 of file WEKAClassifier.java.

Here is the call graph for this function:

void moa.classifiers.meta.WEKAClassifier.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 89 of file WEKAClassifier.java.

Here is the call graph for this function:


Member Data Documentation

Initial value:
 new WEKAClassOption("baseLearner", 'l',
            "Classifier to train.", weka.classifiers.Classifier.class, "weka.classifiers.bayes.NaiveBayesUpdateable")

Definition at line 49 of file WEKAClassifier.java.

Referenced by moa.classifiers.meta.WEKAClassifier.resetLearningImpl().

Initial value:
 new IntOption("sampleFrequency",
            'f',
            "How many instances between samples of the learning performance.",
            0, 0, Integer.MAX_VALUE)

Definition at line 58 of file WEKAClassifier.java.

Referenced by moa.classifiers.meta.WEKAClassifier.trainOnInstanceImpl().

Initial value:
 new IntOption("widthInit",
            'i', "Size of first Window for training learner.", 1000, 0, Integer.MAX_VALUE)

Definition at line 55 of file WEKAClassifier.java.

Referenced by moa.classifiers.meta.WEKAClassifier.trainOnInstanceImpl().

Initial value:
 new IntOption("width",
            'w', "Size of Window for training learner.", 0, 0, Integer.MAX_VALUE)

Definition at line 52 of file WEKAClassifier.java.

Referenced by moa.classifiers.meta.WEKAClassifier.trainOnInstanceImpl().


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