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

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

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

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

Protected Member Functions

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

Protected Attributes

Classifier[] ensemble
ADWIN[] ADError

Detailed Description

Bagging for evolving data streams using ADWIN.

ADWIN is a change detector and estimator that solves in a well-specified way the problem of tracking the average of a stream of bits or real-valued numbers. ADWIN keeps a variable-length window of recently seen items, with the property that the window has the maximal length statistically consistent with the hypothesis “there has been no change in the average value inside the window”.
More precisely, an older fragment of the window is dropped if and only if there is enough evidence that its average value differs from that of the rest of the window. This has two consequences: one, that change reliably declared whenever the window shrinks; and two, that at any time the average over the existing window can be reliably taken as an estimation of the current average in the stream (barring a very small or very recent change that is still not statistically visible). A formal and quantitative statement of these two points (a theorem) appears in

Albert Bifet and Ricard Gavaldà. Learning from time-changing data with adaptive windowing. In SIAM International Conference on Data Mining, 2007.

ADWIN is parameter- and assumption-free in the sense that it automatically detects and adapts to the current rate of change. Its only parameter is a confidence bound δ, indicating how confident we want to be in the algorithm’s output, inherent to all algorithms dealing with random processes. Also important, ADWIN does not maintain the window explicitly, but compresses it using a variant of the exponential histogram technique. This means that it keeps a window of length W using only O(log W) memory and O(log W) processing time per item.
ADWIN Bagging is the online bagging method of Oza and Rusell with the addition of the ADWIN algorithm as a change detector and as an estimator for the weights of the boosting method. When a change is detected, the worst classifier of the ensemble of classifiers is removed and a new classifier is added to the ensemble.

See details in:
[BHPKG] Albert Bifet, Geoff Holmes, Bernhard Pfahringer, Richard Kirkby, and Ricard Gavaldà . New ensemble methods for evolving data streams. In 15th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 2009.

Example: OzaBagAdwin -l HoeffdingTreeNBAdaptive -s 10

Parameters:

  • -l : Classifier to train
  • -s : The number of models in the bag
Author:
Albert Bifet (abifet at cs dot waikato dot ac dot nz)
Version:
Revision:
7

Definition at line 82 of file OzaBagAdwin.java.


Member Function Documentation

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

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

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

Gets the purpose of this object.

Returns:
the string with the purpose of this object

Reimplemented from moa.classifiers.AbstractClassifier.

Definition at line 87 of file OzaBagAdwin.java.

Classifier [] moa.classifiers.meta.OzaBagAdwin.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 180 of file OzaBagAdwin.java.

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

Here is the call graph for this function:

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

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

Here is the call graph for this function:

void moa.classifiers.meta.OzaBagAdwin.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 116 of file OzaBagAdwin.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 91 of file OzaBagAdwin.java.

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

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

Definition at line 94 of file OzaBagAdwin.java.

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


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