weka.filters.unsupervised.attribute
Class TimeSeriesDelta

java.lang.Object
  extended byweka.filters.Filter
      extended byweka.filters.unsupervised.attribute.AbstractTimeSeries
          extended byweka.filters.unsupervised.attribute.TimeSeriesTranslate
              extended byweka.filters.unsupervised.attribute.TimeSeriesDelta
All Implemented Interfaces:
OptionHandler, java.io.Serializable, UnsupervisedFilter

public class TimeSeriesDelta
extends TimeSeriesTranslate

An instance filter that assumes instances form time-series data and replaces attribute values in the current instance with the difference between the current value and the equivalent attribute attribute value of some previous (or future) instance. For instances where the time-shifted value is unknown either the instance may be dropped, or missing values used.

Valid filter-specific options are:

-R index1,index2-index4,...
Specify list of columns to calculate new values for. First and last are valid indexes. (default none)

-V
Invert matching sense (i.e. calculate for all non-specified columns)

-I num
The number of instances forward to take value differences between. A negative number indicates taking values from a past instance. (default -1)

-M
For instances at the beginning or end of the dataset where the delta values are not known, use missing values (default is to remove those instances).

Version:
$Revision: 1.2 $
Author:
Len Trigg (trigg@cs.waikato.ac.nz)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class weka.filters.unsupervised.attribute.AbstractTimeSeries
m_FillWithMissing, m_History, m_InstanceRange, m_SelectedCols
 
Fields inherited from class weka.filters.Filter
m_NewBatch
 
Constructor Summary
TimeSeriesDelta()
           
 
Method Summary
 java.lang.String globalInfo()
          Returns a string describing this classifier
static void main(java.lang.String[] argv)
          Main method for testing this class.
protected  Instance mergeInstances(Instance source, Instance dest)
          Creates a new instance the same as one instance (the "destination") but with some attribute values copied from another instance (the "source")
 boolean setInputFormat(Instances instanceInfo)
          Sets the format of the input instances.
 
Methods inherited from class weka.filters.unsupervised.attribute.AbstractTimeSeries
attributeIndicesTipText, batchFinished, fillWithMissingTipText, getAttributeIndices, getFillWithMissing, getInstanceRange, getInvertSelection, getOptions, historyInput, input, instanceRangeTipText, invertSelectionTipText, listOptions, resetHistory, setAttributeIndices, setAttributeIndicesArray, setFillWithMissing, setInstanceRange, setInvertSelection, setOptions
 
Methods inherited from class weka.filters.Filter
batchFilterFile, bufferInput, copyStringValues, copyStringValues, filterFile, flushInput, getInputFormat, getInputStringIndex, getOutputFormat, getOutputStringIndex, getStringIndices, inputFormat, inputFormatPeek, 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
 

Constructor Detail

TimeSeriesDelta

public TimeSeriesDelta()
Method Detail

globalInfo

public java.lang.String globalInfo()
Returns a string describing this classifier

Overrides:
globalInfo in class TimeSeriesTranslate
Returns:
a description of the classifier suitable for displaying in the explorer/experimenter gui

setInputFormat

public boolean setInputFormat(Instances instanceInfo)
                       throws java.lang.Exception
Sets the format of the input instances.

Overrides:
setInputFormat in class TimeSeriesTranslate
Parameters:
instanceInfo - an Instances object containing the input instance structure (any instances contained in the object are ignored - only the structure is required).
Returns:
true if the outputFormat may be collected immediately
Throws:
UnsupportedAttributeTypeException - if selected attributes are not numeric.
java.lang.Exception

mergeInstances

protected Instance mergeInstances(Instance source,
                                  Instance dest)
Creates a new instance the same as one instance (the "destination") but with some attribute values copied from another instance (the "source")

Overrides:
mergeInstances in class TimeSeriesTranslate
Parameters:
source - the source instance
dest - the destination instance
Returns:
the new merged instance
Throws:
java.lang.Exception - if a problem occurs during merging

main

public static void main(java.lang.String[] argv)
Main method for testing this class.

Parameters:
argv - should contain arguments to the filter: use -h for help