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

Stream generator for a stream based on a randomly generated tree. More...

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

List of all members.

Classes

class  Node

Public Member Functions

String getPurposeString ()
 Gets the purpose of this object.
void prepareForUseImpl (TaskMonitor monitor, ObjectRepository repository)
 This method describes the implementation of how to prepare this object for use.
long estimatedRemainingInstances ()
 Gets the estimated number of remaining instances in this stream.
boolean isRestartable ()
 Gets whether this stream can restart.
void restart ()
 Restarts this stream.
InstancesHeader getHeader ()
 Gets the header of this stream.
boolean hasMoreInstances ()
 Gets whether this stream has more instances to output.
Instance nextInstance ()
 Gets the next instance from this stream.
void getDescription (StringBuilder sb, int indent)
 Returns a string representation of this object.

Public Attributes

IntOption treeRandomSeedOption
IntOption instanceRandomSeedOption
IntOption numClassesOption
IntOption numNominalsOption
IntOption numNumericsOption
IntOption numValsPerNominalOption
IntOption maxTreeDepthOption
IntOption firstLeafLevelOption
FloatOption leafFractionOption

Protected Member Functions

int classifyInstance (Node node, double[] attVals)
void generateHeader ()
void generateRandomTree ()
Node generateRandomTreeNode (int currentDepth, ArrayList< Integer > nominalAttCandidates, double[] minNumericVals, double[] maxNumericVals, Random treeRand)

Protected Attributes

Node treeRoot
InstancesHeader streamHeader
Random instanceRandom

Detailed Description

Stream generator for a stream based on a randomly generated tree.

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

Definition at line 46 of file RandomTreeGenerator.java.


Member Function Documentation

int moa.streams.generators.RandomTreeGenerator.classifyInstance ( Node  node,
double[]  attVals 
) [protected]

Definition at line 162 of file RandomTreeGenerator.java.

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

Here is the caller graph for this function:

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

void moa.streams.generators.RandomTreeGenerator.generateHeader ( ) [protected]

Definition at line 175 of file RandomTreeGenerator.java.

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

Here is the call graph for this function:

Here is the caller graph for this function:

void moa.streams.generators.RandomTreeGenerator.generateRandomTree ( ) [protected]

Definition at line 198 of file RandomTreeGenerator.java.

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

Here is the call graph for this function:

Here is the caller graph for this function:

Node moa.streams.generators.RandomTreeGenerator.generateRandomTreeNode ( int  currentDepth,
ArrayList< Integer >  nominalAttCandidates,
double[]  minNumericVals,
double[]  maxNumericVals,
Random  treeRand 
) [protected]

Definition at line 215 of file RandomTreeGenerator.java.

Referenced by moa.streams.generators.RandomTreeGenerator.generateRandomTree().

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

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

Here is the caller graph for this function:

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

Gets the purpose of this object.

Returns:
the string with the purpose of this object

Reimplemented from moa.options.AbstractOptionHandler.

Definition at line 50 of file RandomTreeGenerator.java.

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

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

Gets whether this stream can restart.

Returns:
true if this stream can restart

Implements moa.streams.InstanceStream.

Definition at line 127 of file RandomTreeGenerator.java.

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

Gets the next instance from this stream.

Returns:
the next instance of this stream

Implements moa.streams.InstanceStream.

Definition at line 147 of file RandomTreeGenerator.java.

Here is the call graph for this function:

void moa.streams.generators.RandomTreeGenerator.prepareForUseImpl ( TaskMonitor  monitor,
ObjectRepository  repository 
) [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 113 of file RandomTreeGenerator.java.

Here is the call graph for this function:

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

Restarts this stream.

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

Implements moa.streams.InstanceStream.

Definition at line 132 of file RandomTreeGenerator.java.

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

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Initial value:
 new IntOption(
            "firstLeafLevel",
            'l',
            "The first level of the tree above maxTreeDepth that can have leaves.",
            3, 0, Integer.MAX_VALUE)

Definition at line 82 of file RandomTreeGenerator.java.

Referenced by moa.streams.generators.RandomTreeGenerator.generateRandomTreeNode().

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

Definition at line 59 of file RandomTreeGenerator.java.

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

Initial value:
 new FloatOption("leafFraction",
            'f',
            "The fraction of leaves per level from firstLeafLevel onwards.",
            0.15, 0.0, 1.0)

Definition at line 88 of file RandomTreeGenerator.java.

Referenced by moa.streams.generators.RandomTreeGenerator.generateRandomTreeNode().

Initial value:
 new IntOption("maxTreeDepth", 'd',
            "The maximum depth of the tree concept.", 5, 0, Integer.MAX_VALUE)

Definition at line 79 of file RandomTreeGenerator.java.

Referenced by moa.streams.generators.RandomTreeGenerator.generateRandomTreeNode().

Initial value:
 new IntOption("numClasses", 'c',
            "The number of classes to generate.", 2, 2, Integer.MAX_VALUE)

Definition at line 63 of file RandomTreeGenerator.java.

Referenced by moa.streams.generators.RandomTreeGenerator.generateHeader(), and moa.streams.generators.RandomTreeGenerator.generateRandomTreeNode().

Initial value:
 new IntOption(
            "numValsPerNominal", 'v',
            "The number of values to generate per nominal attribute.", 5, 2,
            Integer.MAX_VALUE)

Definition at line 74 of file RandomTreeGenerator.java.

Referenced by moa.streams.generators.RandomTreeGenerator.generateHeader(), moa.streams.generators.RandomTreeGenerator.generateRandomTreeNode(), and moa.streams.generators.RandomTreeGenerator.nextInstance().

Initial value:
 new IntOption("treeRandomSeed",
            'r', "Seed for random generation of tree.", 1)

Definition at line 56 of file RandomTreeGenerator.java.

Referenced by moa.streams.generators.RandomTreeGenerator.generateRandomTree().


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