weka.filters.unsupervised.attribute
Class AbstractColumnFinderApplier

java.lang.Object
  extended by weka.filters.Filter
      extended by weka.filters.SimpleFilter
          extended by weka.filters.SimpleBatchFilter
              extended by weka.filters.unsupervised.attribute.AbstractColumnFinderApplier
All Implemented Interfaces:
Serializable, weka.core.CapabilitiesHandler, weka.core.OptionHandler, weka.core.RevisionHandler
Direct Known Subclasses:
DatasetCleaner

public abstract class AbstractColumnFinderApplier
extends weka.filters.SimpleBatchFilter

Ancestor for filters that apply ColumnFinder schemes to the data.

Version:
$Revision: 5754 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Field Summary
protected  ColumnFinder m_ColumnFinder
          The classifier template used to do the classification.
protected  boolean m_Invert
          Whether to invert the column indices.
 
Fields inherited from class weka.filters.SimpleFilter
m_Debug
 
Fields inherited from class weka.filters.Filter
m_FirstBatchDone, m_InputRelAtts, m_InputStringAtts, m_NewBatch, m_OutputRelAtts, m_OutputStringAtts
 
Constructor Summary
AbstractColumnFinderApplier()
           
 
Method Summary
protected abstract  weka.core.Instances apply(weka.core.Instances data, int[] indices)
          Applies the indices to the data.
abstract  String columnFinderTipText()
          Returns the tip text for this property.
protected abstract  weka.core.Instances determineOutputFormat(weka.core.Instances inputFormat)
          Determines the output format based on the input format and returns this.
 weka.core.Capabilities getCapabilities()
          Returns the Capabilities of this filter.
 ColumnFinder getColumnFinder()
          Returns the column finder used by the filter.
 boolean getInvert()
          Returns whether the invert the column indices.
 String[] getOptions()
          Gets the current settings of the classifier.
 String invertTipText()
          Returns the tip text for this property.
 Enumeration listOptions()
          Returns an enumeration describing the available options.
protected  weka.core.Instances process(weka.core.Instances instances)
          Processes the given data (may change the provided dataset) and returns the modified version.
 void setColumnFinder(ColumnFinder value)
          Sets the column finder to use.
 void setInvert(boolean value)
          Set whether the invert the column indices.
 void setOptions(String[] options)
          Parses the options for this object.
 
Methods inherited from class weka.filters.SimpleBatchFilter
batchFinished, hasImmediateOutputFormat, input
 
Methods inherited from class weka.filters.SimpleFilter
debugTipText, getDebug, globalInfo, reset, setDebug, setInputFormat
 
Methods inherited from class weka.filters.Filter
batchFilterFile, bufferInput, copyValues, copyValues, filterFile, flushInput, getCapabilities, getInputFormat, getOutputFormat, getRevision, initInputLocators, initOutputLocators, inputFormatPeek, isFirstBatchDone, isNewBatch, isOutputFormatDefined, main, makeCopies, makeCopy, mayRemoveInstanceAfterFirstBatchDone, numPendingOutput, output, outputFormatPeek, outputPeek, push, resetQueue, runFilter, setOutputFormat, testInputFormat, toString, useFilter, wekaStaticWrapper
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_ColumnFinder

protected ColumnFinder m_ColumnFinder
The classifier template used to do the classification.


m_Invert

protected boolean m_Invert
Whether to invert the column indices.

Constructor Detail

AbstractColumnFinderApplier

public AbstractColumnFinderApplier()
Method Detail

listOptions

public Enumeration listOptions()
Returns an enumeration describing the available options.

Specified by:
listOptions in interface weka.core.OptionHandler
Overrides:
listOptions in class weka.filters.SimpleFilter
Returns:
an enumeration of all the available options.

setOptions

public void setOptions(String[] options)
                throws Exception
Parses the options for this object.

Specified by:
setOptions in interface weka.core.OptionHandler
Overrides:
setOptions in class weka.filters.SimpleFilter
Parameters:
options - the options to use
Throws:
Exception

getOptions

public String[] getOptions()
Gets the current settings of the classifier.

Specified by:
getOptions in interface weka.core.OptionHandler
Overrides:
getOptions in class weka.filters.SimpleFilter
Returns:
an array of strings suitable for passing to setOptions

getCapabilities

public weka.core.Capabilities getCapabilities()
Returns the Capabilities of this filter.

Specified by:
getCapabilities in interface weka.core.CapabilitiesHandler
Overrides:
getCapabilities in class weka.filters.Filter
Returns:
the capabilities of this object
See Also:
Capabilities

setColumnFinder

public void setColumnFinder(ColumnFinder value)
Sets the column finder to use.

Parameters:
value - The column finder to be used (with its options set).

getColumnFinder

public ColumnFinder getColumnFinder()
Returns the column finder used by the filter.

Returns:
The column finder to be used.

columnFinderTipText

public abstract String columnFinderTipText()
Returns the tip text for this property.

Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui

setInvert

public void setInvert(boolean value)
Set whether the invert the column indices.

Parameters:
value - true if to invert the indices

getInvert

public boolean getInvert()
Returns whether the invert the column indices.

Returns:
true if the indices get inverted

invertTipText

public String invertTipText()
Returns the tip text for this property.

Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui

determineOutputFormat

protected abstract weka.core.Instances determineOutputFormat(weka.core.Instances inputFormat)
                                                      throws Exception
Determines the output format based on the input format and returns this. In case the output format cannot be returned immediately, i.e., immediateOutputFormat() returns false, then this method will be called from batchFinished().

Specified by:
determineOutputFormat in class weka.filters.SimpleFilter
Parameters:
inputFormat - the input format to base the output format on
Returns:
the output format
Throws:
Exception

apply

protected abstract weka.core.Instances apply(weka.core.Instances data,
                                             int[] indices)
Applies the indices to the data. In case inverting is enabled, the indices have already been inverted.

Parameters:
data - the data to process
indices - the indices to use
Returns:
the processed data

process

protected weka.core.Instances process(weka.core.Instances instances)
                               throws Exception
Processes the given data (may change the provided dataset) and returns the modified version. This method is called in batchFinished().

Specified by:
process in class weka.filters.SimpleFilter
Parameters:
instances - the data to process
Returns:
the modified data
Throws:
Exception
See Also:
SimpleBatchFilter.batchFinished()


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.