MOA 12.03
Real Time Analytics for Data Streams
moa.streams.generators.STAGGERGenerator Class Reference

Stream generator for STAGGER Concept functions. More...

Inheritance diagram for moa.streams.generators.STAGGERGenerator:
Collaboration diagram for moa.streams.generators.STAGGERGenerator:

List of all members.

Classes

interface  ClassFunction

Public Member Functions

String getPurposeString ()
 Gets the purpose of this object.
long estimatedRemainingInstances ()
 Gets the estimated number of remaining instances in this stream.
InstancesHeader getHeader ()
 Gets the header of this stream.
boolean hasMoreInstances ()
 Gets whether this stream has more instances to output.
boolean isRestartable ()
 Gets whether this stream can restart.
Instance nextInstance ()
 Gets the next instance from this stream.
void restart ()
 Restarts this stream.
void getDescription (StringBuilder sb, int indent)
 Returns a string representation of this object.

Public Attributes

IntOption instanceRandomSeedOption
IntOption functionOption
FlagOption balanceClassesOption

Protected Member Functions

void prepareForUseImpl (TaskMonitor monitor, ObjectRepository repository)
 This method describes the implementation of how to prepare this object for use.

Protected Attributes

InstancesHeader streamHeader
Random instanceRandom
boolean nextClassShouldBeZero

Static Protected Attributes

static ClassFunction[] classificationFunctions

Detailed Description

Stream generator for STAGGER Concept functions.

Generator described in the paper:
Jeffrey C. Schlimmer and Richard H. Granger Jr. "Incremental Learning from Noisy Data", Machine Learning 1: 317-354 1986.

Notes:
The built in functions are based on the paper (page 341).

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

Definition at line 52 of file STAGGERGenerator.java.


Member Function Documentation

long moa.streams.generators.STAGGERGenerator.estimatedRemainingInstances ( )

Gets the estimated number of remaining instances in this stream.

Returns:
the estimated number of instances to get from this stream

Implements moa.streams.InstanceStream.

Definition at line 146 of file STAGGERGenerator.java.

void moa.streams.generators.STAGGERGenerator.getDescription ( StringBuilder  sb,
int  indent 
)

Returns a string representation of this object.

Used in AbstractMOAObject.toString to give a string representation of the object.

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

Implements moa.MOAObject.

Definition at line 208 of file STAGGERGenerator.java.

InstancesHeader moa.streams.generators.STAGGERGenerator.getHeader ( )

Gets the header of this stream.

This is useful to know attributes and classes. InstancesHeader is an extension of weka.Instances.

Returns:
the header of this stream

Implements moa.streams.InstanceStream.

Definition at line 151 of file STAGGERGenerator.java.

Referenced by moa.streams.generators.STAGGERGenerator.nextInstance().

Here is the caller graph for this function:

String moa.streams.generators.STAGGERGenerator.getPurposeString ( )

Gets the purpose of this object.

Returns:
the string with the purpose of this object

Reimplemented from moa.options.AbstractOptionHandler.

Definition at line 56 of file STAGGERGenerator.java.

boolean moa.streams.generators.STAGGERGenerator.hasMoreInstances ( )

Gets whether this stream has more instances to output.

This is useful when reading streams from files.

Returns:
true if this stream has more instances to output

Implements moa.streams.InstanceStream.

Definition at line 156 of file STAGGERGenerator.java.

boolean moa.streams.generators.STAGGERGenerator.isRestartable ( )

Gets whether this stream can restart.

Returns:
true if this stream can restart

Implements moa.streams.InstanceStream.

Definition at line 161 of file STAGGERGenerator.java.

Instance moa.streams.generators.STAGGERGenerator.nextInstance ( )

Gets the next instance from this stream.

Returns:
the next instance of this stream

Implements moa.streams.InstanceStream.

Definition at line 166 of file STAGGERGenerator.java.

Here is the call graph for this function:

void moa.streams.generators.STAGGERGenerator.prepareForUseImpl ( TaskMonitor  monitor,
ObjectRepository  repository 
) [protected, virtual]

This method describes the implementation of how to prepare this object for use.

All classes that extends this class have to implement prepareForUseImpl and not prepareForUse since prepareForUse calls prepareForUseImpl.

Parameters:
monitorthe TaskMonitor to use
repositorythe ObjectRepository to use

Implements moa.options.AbstractOptionHandler.

Definition at line 112 of file STAGGERGenerator.java.

Here is the call graph for this function:

void moa.streams.generators.STAGGERGenerator.restart ( )

Restarts this stream.

It must be similar to starting a new stream from scratch.

Implements moa.streams.InstanceStream.

Definition at line 202 of file STAGGERGenerator.java.

Referenced by moa.streams.generators.STAGGERGenerator.prepareForUseImpl().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Initial value:
 new FlagOption("balanceClasses",
            'b', "Balance the number of instances of each class.")

Definition at line 70 of file STAGGERGenerator.java.

Referenced by moa.streams.generators.STAGGERGenerator.nextInstance().

Initial value:
 {
        
        new ClassFunction() {

    @Override
    public int determineClass(int size, int color, int shape) {
        return (size == 0 && color == 0) ? 0 : 1; 
    }
},
        
        new ClassFunction() {

    @Override
    public int determineClass(int size, int color, int shape) {
        return (color == 2 || shape == 1) ? 0 : 1; 
    }
},
        
        new ClassFunction() {

    @Override
    public int determineClass(int size, int color, int shape) {
        return (size == 1 || size == 2) ? 0 : 1; 
    }
}
    }

Definition at line 78 of file STAGGERGenerator.java.

Referenced by moa.streams.generators.STAGGERGenerator.nextInstance().

Initial value:
 new IntOption("function", 'f',
            "Classification function used, as defined in the original paper.",
            1, 1, 3)

Definition at line 66 of file STAGGERGenerator.java.

Referenced by moa.streams.generators.STAGGERGenerator.nextInstance().

Initial value:
 new IntOption(
            "instanceRandomSeed", 'i',
            "Seed for random generation of instances.", 1)

Definition at line 62 of file STAGGERGenerator.java.

Referenced by moa.streams.generators.STAGGERGenerator.restart().


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