weka.attributeSelection
Class TPPAttributeSearch

java.lang.Object
  extended by weka.attributeSelection.ASSearch
      extended by weka.attributeSelection.TPPAttributeSearch
All Implemented Interfaces:
java.awt.event.WindowListener, java.io.Serializable, java.util.EventListener, TPPModelEventListener, RankedOutputSearch, CapabilitiesHandler, OptionHandler, RevisionHandler, TechnicalInformationHandler

public class TPPAttributeSearch
extends ASSearch
implements java.awt.event.WindowListener, RankedOutputSearch, OptionHandler, TechnicalInformationHandler, TPPModelEventListener, CapabilitiesHandler

Class that uses Targeted Projection Pursuit as a attribute selection algorithm. TPP is used to produce an N-dimensional (usually N=2) projection of the data that separates classes in the data. The components in the resulting projection are then used to rank each attribute. In order to reduce execution time (if the number of attributes is large, say >1000) we can optionally use IG to preselect a subset of attributes. The user can also see the resulting views of the data as they are produced. Should be used with a TPPAttributeEvaluation evaluator (which is a dummy evaluator that does nothing). The user can also specify the maximum number of cycles in training and/or a convergence limit

See C.Haddow, J.Perry, M.Durrant and J.Faith, "Predicting Functional Residues of Protein Sequence Alignments as a Feature Selection Task" , International Journal of Data Mining in Bioinformatics, 2011

See Also:
Serialized Form

Constructor Summary
TPPAttributeSearch()
           
 
Method Summary
 int getCalculatedNumToSelect()
           
 Capabilities getCapabilities()
          Returns the capabilities of this evaluator.
 double getConvergenceLimit()
           
 int getEpochLimit()
           
 boolean getGenerateRanking()
          This class will always rank attributes, so this method always returns true
 int getNumOutputDimensions()
          The number of output dimensions (default=2)
 int getNumToPreSelect()
          The number of attributes to pre-select using IG
 int getNumToSelect()
           
 java.lang.String[] getOptions()
          Gets the current settings of attributes.
 boolean getShowView()
          Whether to show the projected data as it is separated
 TechnicalInformation getTechnicalInformation()
          Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.
 double getThreshold()
           
 java.lang.String globalInfo()
           
 java.util.Enumeration listOptions()
          Returns an enumeration describing the available options.
static void main(java.lang.String[] a)
          Test method
 void modelChanged(TPPModelEvent e)
           
 double[][] rankedAttributes()
           
 int[] search(ASEvaluation evaluator, Instances data)
          Use TPP to select attributes.
 void setConvergenceLimit(double convergenceLimit)
          The limit at which TPP is treated as converged
 void setEpochLimit(int epochLimit)
          The maximum number of training cycles that TPP should run for
 void setGenerateRanking(boolean doRanking)
          Whether to rank the selected attributes.
 void setNumOutputDimensions(int numOutputDimensions)
          The number of output dimensions (default=2)
 void setNumToPreSelect(int numToPreSelect)
          The number of attributes to preselect using IG.
 void setNumToSelect(int numToSelect)
          The number of attributes to select.
 void setOptions(java.lang.String[] options)
          Parses a given list of options.
 void setShowView(boolean showView)
          Whether to show the projected data as it is separated
 void setThreshold(double threshold)
           
 java.lang.String toString()
           
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
           
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
 
Methods inherited from class weka.attributeSelection.ASSearch
forName, getRevision, makeCopies
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TPPAttributeSearch

public TPPAttributeSearch()
Method Detail

globalInfo

public java.lang.String globalInfo()

getTechnicalInformation

public TechnicalInformation getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.

Specified by:
getTechnicalInformation in interface TechnicalInformationHandler
Returns:
the technical information about this class

search

public int[] search(ASEvaluation evaluator,
                    Instances data)
             throws java.lang.Exception
Use TPP to select attributes. The Evaluator is ignored.

Specified by:
search in class ASSearch
Throws:
java.lang.Exception

modelChanged

public void modelChanged(TPPModelEvent e)
Specified by:
modelChanged in interface TPPModelEventListener

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Specified by:
windowClosed in interface java.awt.event.WindowListener

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Specified by:
windowClosing in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Specified by:
windowIconified in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Specified by:
windowOpened in interface java.awt.event.WindowListener

getCalculatedNumToSelect

public int getCalculatedNumToSelect()
Specified by:
getCalculatedNumToSelect in interface RankedOutputSearch

getGenerateRanking

public boolean getGenerateRanking()
This class will always rank attributes, so this method always returns true

Specified by:
getGenerateRanking in interface RankedOutputSearch

getNumToSelect

public int getNumToSelect()
Specified by:
getNumToSelect in interface RankedOutputSearch

getNumToPreSelect

public int getNumToPreSelect()
The number of attributes to pre-select using IG


getThreshold

public double getThreshold()
Specified by:
getThreshold in interface RankedOutputSearch

getShowView

public boolean getShowView()
Whether to show the projected data as it is separated


setShowView

public void setShowView(boolean showView)
Whether to show the projected data as it is separated


rankedAttributes

public double[][] rankedAttributes()
                            throws java.lang.Exception
Specified by:
rankedAttributes in interface RankedOutputSearch
Throws:
java.lang.Exception

setGenerateRanking

public void setGenerateRanking(boolean doRanking)
Whether to rank the selected attributes. This class will always rank the selected attributes, and so this method does nothing.

Specified by:
setGenerateRanking in interface RankedOutputSearch

setNumToSelect

public void setNumToSelect(int numToSelect)
The number of attributes to select. if -1 then select all

Specified by:
setNumToSelect in interface RankedOutputSearch

setNumToPreSelect

public void setNumToPreSelect(int numToPreSelect)
The number of attributes to preselect using IG. if =0 then do not preselect.


setThreshold

public void setThreshold(double threshold)
Specified by:
setThreshold in interface RankedOutputSearch

getEpochLimit

public int getEpochLimit()

setEpochLimit

public void setEpochLimit(int epochLimit)
The maximum number of training cycles that TPP should run for


getConvergenceLimit

public double getConvergenceLimit()

setConvergenceLimit

public void setConvergenceLimit(double convergenceLimit)
The limit at which TPP is treated as converged


getNumOutputDimensions

public int getNumOutputDimensions()
The number of output dimensions (default=2)


setNumOutputDimensions

public void setNumOutputDimensions(int numOutputDimensions)
The number of output dimensions (default=2)


listOptions

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

Specified by:
listOptions in interface OptionHandler
Returns:
an enumeration of all the available options.

setOptions

public void setOptions(java.lang.String[] options)
                throws java.lang.Exception
Parses a given list of options.

                      -N <number of attributes>
                       The number of attributes to select.
                      -P <number of attributes to preselect>
                       The number of attributes to preselect.
                      -V;
                       Show resulting data visualisation.
                      -L <convergence limit>
                      -C <maximum number of training cycles>
                      -D <number of output dimensions>
 

Specified by:
setOptions in interface OptionHandler
Parameters:
options - the list of options as an array of strings
Throws:
java.lang.Exception - if an option is not supported

getOptions

public java.lang.String[] getOptions()
Gets the current settings of attributes.

Specified by:
getOptions in interface OptionHandler
Returns:
an array of strings suitable for passing to setOptions()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getCapabilities

public Capabilities getCapabilities()
Returns the capabilities of this evaluator.

Specified by:
getCapabilities in interface CapabilitiesHandler
Returns:
the capabilities of this search
See Also:
Capabilities

main

public static void main(java.lang.String[] a)
                 throws java.lang.Exception
Test method

Throws:
java.lang.Exception