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

Leveraging Bagging for evolving data streams using ADWIN. More...

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

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.
double[] getVotesForInstanceBinary (Instance inst)
boolean isRandomizable ()
 Gets whether this classifier needs a random seed.
void getModelDescription (StringBuilder out, int indent)
 Returns a string representation of the model.
Classifier[] getSubClassifiers ()
 Gets the classifiers of this ensemble.

Public Attributes

ClassOption baseLearnerOption
IntOption ensembleSizeOption
FloatOption weightShrinkOption
FloatOption deltaAdwinOption
FlagOption outputCodesOption
MultiChoiceOption leveraginBagAlgorithmOption

Protected Member Functions

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

Protected Attributes

Classifier[] ensemble
ADWIN[] ADError
int numberOfChangesDetected
int[][] matrixCodes
boolean initMatrixCodes = false

Detailed Description

Leveraging Bagging for evolving data streams using ADWIN.

Leveraging Bagging and Leveraging Bagging MC using Random Output Codes ( -o option).

See details in:
Albert Bifet, Geoffrey Holmes, Bernhard Pfahringer. Leveraging Bagging for Evolving Data Streams Machine Learning and Knowledge Discovery in Databases, European Conference, ECML PKDD}, 2010.

Author:
Albert Bifet (abifet at cs dot waikato dot ac dot nz)
Version:
Revision:
7

Definition at line 43 of file LeveragingBag.java.


Member Function Documentation

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

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

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

Gets the purpose of this object.

Returns:
the string with the purpose of this object

Reimplemented from moa.classifiers.AbstractClassifier.

Definition at line 48 of file LeveragingBag.java.

Classifier [] moa.classifiers.meta.LeveragingBag.getSubClassifiers ( )

Gets the classifiers of this ensemble.

Returns null if this classifier is a single classifier.

Returns:
an array of the classifiers of the ensemble

Reimplemented from moa.classifiers.AbstractClassifier.

Definition at line 263 of file LeveragingBag.java.

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

Here is the call graph for this function:

double [] moa.classifiers.meta.LeveragingBag.getVotesForInstanceBinary ( Instance  inst)

Definition at line 218 of file LeveragingBag.java.

Referenced by moa.classifiers.meta.LeveragingBag.getVotesForInstance().

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

Here is the call graph for this function:

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

Here is the call graph for this function:


Member Data Documentation

Initial value:
 new ClassOption("baseLearner", 'l',
            "Classifier to train.", Classifier.class, "trees.HoeffdingTree")

Definition at line 52 of file LeveragingBag.java.

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

Initial value:
 new FloatOption("deltaAdwin", 'a',
            "Delta of Adwin change detection", 0.002, 0.0, 1.0)

Definition at line 61 of file LeveragingBag.java.

Referenced by moa.classifiers.meta.LeveragingBag.resetLearningImpl(), and moa.classifiers.meta.LeveragingBag.trainOnInstanceImpl().

Initial value:
 new IntOption("ensembleSize", 's',
            "The number of models in the bag.", 10, 1, Integer.MAX_VALUE)

Definition at line 55 of file LeveragingBag.java.

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

Initial value:
 new MultiChoiceOption(
            "leveraginBagAlgorithm", 'm', "Leveraging Bagging to use.", new String[]{
                "LeveragingBag", "LeveragingBagME", "LeveragingBagHalf", "LeveragingBagWT", "LeveragingSubag"},
            new String[]{"Leveraging Bagging for evolving data streams using ADWIN",
                "Leveraging Bagging ME using weight 1 if misclassified, otherwise error/(1-error)",
                "Leveraging Bagging Half using resampling without replacement half of the instances",
                "Leveraging Bagging WT without taking out all instances.",
                "Leveraging Subagging using resampling without replacement."
            }, 0)

Definition at line 68 of file LeveragingBag.java.

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

Initial value:
 new FloatOption("weightShrink", 'w',
            "The number to use to compute the weight of new instances.", 6, 0.0, Float.MAX_VALUE)

Definition at line 58 of file LeveragingBag.java.

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


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