|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.filters.Filter
wpi.filters.EventFilter
Finds time periods during which events occur in time
sequence attribute values. Three events are currently
supported: increase, decrease and sustain.
A new attribute containing the events found is appended
after the last attribute.
Valid filter-specific options are:
-A attributes
Specify which attributes to find events in.
-I
Find increase events.
-D
Find decrease events.
-S
Find sustain events.
-T
Specify the tolerance to use when including values in events.
-N
Specify the minimum required number of values in an event
Field Summary | |
protected java.lang.String |
attributeString
The original string for attributes to look for events in |
static java.lang.String |
DECREASE_EVENTS
The string to append to an attribute's name for decrease events. |
private static int |
DECREASE_INT
|
protected boolean |
decreaseEvents
find decrease events? |
static java.lang.String |
INCREASE_EVENTS
The string to append to an attribute's name for increase events. |
private static int |
INCREASE_INT
|
protected boolean |
increaseEvents
find increase events? |
static int |
MIN_NUM_VALUES_DEFAULT
The default min number of values in an event |
protected int |
minNumValues
minimum required number of values for events |
static char |
SETBEGIN
|
static char |
SETDELIMITER
The delimiters to use for sets of events |
static char |
SETEND
|
static java.lang.String |
SUSTAIN_EVENTS
The string to append to an attribute's name for decrease events. |
private static int |
SUSTAIN_INT
|
protected boolean |
sustainEvents
find sustain events? |
private java.util.Vector |
timeSequenceAttributeVector
list of time sequence attributes to find events in |
protected double |
tolerance
tolerance for events |
static double |
TOLERANCE_DEFAULT
The default tolerance |
Fields inherited from class weka.filters.Filter |
m_NewBatch |
Constructor Summary | |
EventFilter()
|
Method Summary | |
java.lang.String |
attributeStringTipText()
|
boolean |
batchFinished()
Signifies that this batch of input to the filter is finished. |
java.lang.String |
decreaseEventsTipText()
|
protected void |
findTimeSequenceAttributes()
Finds the time sequence attributes in the input format. |
java.util.Vector |
getAttributes()
Returns the time sequence attributes to find events in |
java.lang.String |
getAttributeString()
Returns the original option for attributes to find events in |
boolean |
getDecreaseEvents()
Returns if the filter is set to find decrease events. |
private java.lang.String |
getEvents(weka.core.Instance instance,
java.lang.String attribute,
int eventType)
Finds events of the specified type in the instance for the attribute specified. |
boolean |
getIncreaseEvents()
Returns if the filter is set to find increase events. |
int |
getMinNumValues()
Returns the minimum required number of values for events |
java.lang.String[] |
getOptions()
Gets the current settings of the filter. |
boolean |
getSustainEvents()
Returns if the filter is set to find sustain events. |
double |
getTolerance()
Returns the tolerance value in use. |
java.lang.String |
globalInfo()
Returns a string describing this filter. |
java.lang.String |
increaseEventsTipText()
|
boolean |
input(weka.core.Instance instance)
Input an instance for filtering. |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options |
static void |
main(java.lang.String[] argv)
Main method for testing this class. |
java.lang.String |
minNumValuesTipText()
|
void |
setAttributeString(java.lang.String a)
Sets the attribute to find events in |
void |
setDecreaseEvents(boolean b)
Sets if the filter should find decrease events. |
void |
setIncreaseEvents(boolean b)
Sets if the filter should find increase events. |
boolean |
setInputFormat(weka.core.Instances instanceInfo)
Sets the format of the input instances. |
void |
setMinNumValues(int n)
Sets the minimum required number of values in an event |
void |
setMinNumValues(java.lang.String n)
Sets the minimum required number of values in an event |
void |
setOptions(java.lang.String[] options)
Parses a list of options for this object. |
private void |
setOutputFormat()
Sets the output format. |
void |
setSustainEvents(boolean b)
Sets if the filter should find sustain events. |
void |
setTolerance(double t)
Sets the event tolerance. |
void |
setToleranceString(java.lang.String t)
Sets the event tolerance. |
java.lang.String |
sustainEventsTipText()
|
java.lang.String |
toleranceTipText()
|
Methods inherited from class weka.filters.Filter |
batchFilterFile, bufferInput, copyStringValues, copyStringValues, filterFile, flushInput, getInputFormat, getInputStringIndex, getOutputFormat, getOutputStringIndex, getStringIndices, inputFormat, isOutputFormatDefined, numPendingOutput, output, outputFormat, outputFormatPeek, outputPeek, push, resetQueue, setOutputFormat, useFilter |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static java.lang.String INCREASE_EVENTS
public static java.lang.String DECREASE_EVENTS
public static java.lang.String SUSTAIN_EVENTS
private static final int INCREASE_INT
private static final int DECREASE_INT
private static final int SUSTAIN_INT
public static char SETDELIMITER
public static char SETBEGIN
public static char SETEND
public static double TOLERANCE_DEFAULT
public static int MIN_NUM_VALUES_DEFAULT
private java.util.Vector timeSequenceAttributeVector
protected java.lang.String attributeString
protected double tolerance
protected int minNumValues
protected boolean increaseEvents
protected boolean decreaseEvents
protected boolean sustainEvents
Constructor Detail |
public EventFilter()
Method Detail |
public void setAttributeString(java.lang.String a)
a
- the attributepublic java.util.Vector getAttributes()
public java.lang.String attributeStringTipText()
public java.lang.String getAttributeString()
public void setToleranceString(java.lang.String t)
t
- the percentage by which values can differ and still
be included into an event.public void setTolerance(double t)
t
- the percentage by which values can differ and still
be included into an event.public double getTolerance()
public java.lang.String toleranceTipText()
public void setMinNumValues(java.lang.String n)
n
- the minimum number of values in an eventpublic void setMinNumValues(int n)
n
- the minimum number of values in an eventpublic int getMinNumValues()
public java.lang.String minNumValuesTipText()
public void setIncreaseEvents(boolean b)
b
- true to find increase events, false otherwisepublic boolean getIncreaseEvents()
public java.lang.String increaseEventsTipText()
public void setDecreaseEvents(boolean b)
b
- true to find decrease events, false otherwisepublic boolean getDecreaseEvents()
public java.lang.String decreaseEventsTipText()
public void setSustainEvents(boolean b)
b
- true to find sustain events, false otherwisepublic boolean getSustainEvents()
public java.lang.String sustainEventsTipText()
private java.lang.String getEvents(weka.core.Instance instance, java.lang.String attribute, int eventType)
public boolean setInputFormat(weka.core.Instances instanceInfo) throws java.lang.Exception
instanceInfo
- an Instances object containing the input instance
structure (any values of instances contained in the object are
ignored) but in addition to the structure, this filter does require
to know the number of instances in the input data set.
java.lang.Exception
- if the format couldn't be set successfullyprivate void setOutputFormat()
protected void findTimeSequenceAttributes()
public boolean input(weka.core.Instance instance)
instance
- the input instance
java.lang.IllegalStateException
- if no input format has been defined.public boolean batchFinished()
java.lang.IllegalStateException
- if no input structure has been defined.public java.lang.String globalInfo()
public java.util.Enumeration listOptions()
listOptions
in interface weka.core.OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
setOptions
in interface weka.core.OptionHandler
options
- the list of options as an array of strings
-A attributes java.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface weka.core.OptionHandler
public static void main(java.lang.String[] argv)
argv
- should contain arguments to the filter:
use -h for help
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |