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

Stream generator for Agrawal dataset. More...

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

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 functionOption
IntOption instanceRandomSeedOption
FloatOption peturbFractionOption
FlagOption balanceClassesOption

Protected Member Functions

void prepareForUseImpl (TaskMonitor monitor, ObjectRepository repository)
 This method describes the implementation of how to prepare this object for use.
double perturbValue (double val, double min, double max)
double perturbValue (double val, double range, double min, double max)

Protected Attributes

InstancesHeader streamHeader
Random instanceRandom
boolean nextClassShouldBeZero

Static Protected Attributes

static ClassFunction[] classificationFunctions

Detailed Description

Stream generator for Agrawal dataset.

Generator described in paper:
Rakesh Agrawal, Tomasz Imielinksi, and Arun Swami, "Database Mining: A Performance Perspective", IEEE Transactions on Knowledge and Data Engineering, 5(6), December 1993.

Public C source code available at:
http://www.almaden.ibm.com/cs/projects/iis/hdb/Projects/data_mining/datasets/syndata.html

Notes:
The built in functions are based on the paper (page 924), which turn out to be functions pred20 thru pred29 in the public C implementation. Perturbation function works like C implementation rather than description in paper.

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

Definition at line 59 of file AgrawalGenerator.java.


Member Function Documentation

long moa.streams.generators.AgrawalGenerator.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 313 of file AgrawalGenerator.java.

void moa.streams.generators.AgrawalGenerator.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 418 of file AgrawalGenerator.java.

InstancesHeader moa.streams.generators.AgrawalGenerator.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 318 of file AgrawalGenerator.java.

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

Here is the caller graph for this function:

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

Gets the purpose of this object.

Returns:
the string with the purpose of this object

Reimplemented from moa.options.AbstractOptionHandler.

Definition at line 63 of file AgrawalGenerator.java.

boolean moa.streams.generators.AgrawalGenerator.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 323 of file AgrawalGenerator.java.

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

Gets whether this stream can restart.

Returns:
true if this stream can restart

Implements moa.streams.InstanceStream.

Definition at line 328 of file AgrawalGenerator.java.

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

Gets the next instance from this stream.

Returns:
the next instance of this stream

Implements moa.streams.InstanceStream.

Definition at line 333 of file AgrawalGenerator.java.

Here is the call graph for this function:

double moa.streams.generators.AgrawalGenerator.perturbValue ( double  val,
double  min,
double  max 
) [protected]

Definition at line 395 of file AgrawalGenerator.java.

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

Here is the caller graph for this function:

double moa.streams.generators.AgrawalGenerator.perturbValue ( double  val,
double  range,
double  min,
double  max 
) [protected]

Definition at line 399 of file AgrawalGenerator.java.

Here is the call graph for this function:

void moa.streams.generators.AgrawalGenerator.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 277 of file AgrawalGenerator.java.

Here is the call graph for this function:

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

Restarts this stream.

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

Implements moa.streams.InstanceStream.

Definition at line 412 of file AgrawalGenerator.java.

Referenced by moa.streams.generators.AgrawalGenerator.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 82 of file AgrawalGenerator.java.

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

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

Definition at line 69 of file AgrawalGenerator.java.

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

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

Definition at line 73 of file AgrawalGenerator.java.

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

Initial value:
 new FloatOption("peturbFraction",
            'p',
            "The amount of peturbation (noise) introduced to numeric values.",
            0.05, 0.0, 1.0)

Definition at line 77 of file AgrawalGenerator.java.

Referenced by moa.streams.generators.AgrawalGenerator.nextInstance(), and moa.streams.generators.AgrawalGenerator.perturbValue().


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