MOA 12.03
Real Time Analytics for Data Streams
moa.streams.clustering.FileStream Class Reference
Inheritance diagram for moa.streams.clustering.FileStream:
Collaboration diagram for moa.streams.clustering.FileStream:

List of all members.

Public Member Functions

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

Public Attributes

FileOption arffFileOption
IntOption classIndexOption
FlagOption normalizeOption
ListOption removeAttributesOption
FlagOption keepNonNumericalAttrOption

Protected Member Functions

boolean readNextInstanceFromFile ()
ArrayList< Double[]> readMinMaxDiffValues (HashSet< Integer > ignoredAttributes)

Protected Attributes

Instances instances
Reader fileReader
boolean hitEndOfFile
Instance lastInstanceRead
int numInstancesRead
InputStreamProgressMonitor fileProgressMonitor

Package Attributes

String defaultfile = ""

Detailed Description

Definition at line 46 of file FileStream.java.


Constructor & Destructor Documentation

moa.streams.clustering.FileStream.FileStream ( )

Definition at line 105 of file FileStream.java.


Member Function Documentation

long moa.streams.clustering.FileStream.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 120 of file FileStream.java.

Here is the call graph for this function:

void moa.streams.clustering.FileStream.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 322 of file FileStream.java.

InstancesHeader moa.streams.clustering.FileStream.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 116 of file FileStream.java.

String moa.streams.clustering.FileStream.getPurposeString ( )

Gets the purpose of this object.

Returns:
the string with the purpose of this object

Reimplemented from moa.options.AbstractOptionHandler.

Definition at line 49 of file FileStream.java.

boolean moa.streams.clustering.FileStream.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 129 of file FileStream.java.

boolean moa.streams.clustering.FileStream.isRestartable ( )

Gets whether this stream can restart.

Returns:
true if this stream can restart

Implements moa.streams.InstanceStream.

Definition at line 139 of file FileStream.java.

Instance moa.streams.clustering.FileStream.nextInstance ( )

Gets the next instance from this stream.

Returns:
the next instance of this stream

Implements moa.streams.InstanceStream.

Definition at line 133 of file FileStream.java.

Here is the call graph for this function:

void moa.streams.clustering.FileStream.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 111 of file FileStream.java.

Here is the call graph for this function:

ArrayList<Double[]> moa.streams.clustering.FileStream.readMinMaxDiffValues ( HashSet< Integer >  ignoredAttributes) [protected]
Parameters:
ignoredAttributesAttributes that will be ignored
Returns:
A list with min/max and diff=max-min values per attribute of the arff file

Definition at line 262 of file FileStream.java.

Referenced by moa.streams.clustering.FileStream.restart().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean moa.streams.clustering.FileStream.readNextInstanceFromFile ( ) [protected]

Definition at line 218 of file FileStream.java.

Referenced by moa.streams.clustering.FileStream.nextInstance(), and moa.streams.clustering.FileStream.restart().

Here is the caller graph for this function:

void moa.streams.clustering.FileStream.restart ( )

Restarts this stream.

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

Implements moa.streams.InstanceStream.

Definition at line 143 of file FileStream.java.

Referenced by moa.streams.clustering.FileStream.prepareForUseImpl().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Initial value:
 new FileOption("arffFile", 'f',
                        "ARFF file to load.", defaultfile, "arff", false)

Definition at line 58 of file FileStream.java.

Referenced by moa.streams.clustering.FileStream.readMinMaxDiffValues(), and moa.streams.clustering.FileStream.restart().

Initial value:
 new IntOption(
                        "classIndex",
                        'c',
                        "Class index of data. 0 for none or -1 for last attribute in file.",
                        -1, -1, Integer.MAX_VALUE)

Definition at line 61 of file FileStream.java.

Referenced by moa.streams.clustering.FileStream.restart().

Definition at line 56 of file FileStream.java.

Initial value:
 
                new FlagOption("keepNonNumericalAttr", 'K',
                "Non-numerical attributes are being filtered by default " +
                "(except the class attribute). " +
                "Check to keep all attributes. This option is being " +
                "overwritten by the manual attribute removal filter.")

Definition at line 78 of file FileStream.java.

Referenced by moa.streams.clustering.FileStream.restart().

Initial value:
 
                new FlagOption("normalize", 'n', 
                                "Numerical data will be normalized to 0-1 " +
                                "for the visualization to work. The complete arff file needs to be read upfront.")

Definition at line 67 of file FileStream.java.

Referenced by moa.streams.clustering.FileStream.readNextInstanceFromFile(), and moa.streams.clustering.FileStream.restart().

Initial value:
 new ListOption("removeAttributes", 'r',
            "Attributes to remove. Enter comma seperated list, " +
            "starting with 1 for first attribute.", 
            new IntOption("removeAttribute", ' ', "Attribute to remove.",-1),
            new Option[0], ',')

Definition at line 72 of file FileStream.java.

Referenced by moa.streams.clustering.FileStream.restart().


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