weka.attributeSelection
Class RankSearch

java.lang.Object
  |
  +--weka.attributeSelection.ASSearch
        |
        +--weka.attributeSelection.RankSearch
All Implemented Interfaces:
OptionHandler, Serializable

public class RankSearch
extends ASSearch
implements OptionHandler

Class for evaluating a attribute ranking (given by a specified evaluator) using a specified subset evaluator.

Valid options are:

-A
Specify the attribute/subset evaluator to be used for generating the ranking. If a subset evaluator is specified then a forward selection search is used to produce a ranked list of attributes.

Version:
$Revision: 1.6 $
Author:
Mark Hall (mhall@cs.waikato.ac.nz)
See Also:
Serialized Form

Constructor Summary
RankSearch()
           
 
Method Summary
 String attributeEvaluatorTipText()
          Returns the tip text for this property
 ASEvaluation getAttributeEvaluator()
          Get the attribute evaluator used to generate the ranking.
 String[] getOptions()
          Gets the current settings of WrapperSubsetEval.
 String globalInfo()
          Returns a string describing this search method
 Enumeration listOptions()
          Returns an enumeration describing the available options
protected  void resetOptions()
          Reset the search method.
 int[] search(ASEvaluation ASEval, Instances data)
          Ranks attributes using the specified attribute evaluator and then searches the ranking using the supplied subset evaluator.
 void setAttributeEvaluator(ASEvaluation newEvaluator)
          Set the attribute evaluator to use for generating the ranking.
 void setOptions(String[] options)
          Parses a given list of options.
 String toString()
          returns a description of the search as a String
 
Methods inherited from class weka.attributeSelection.ASSearch
forName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RankSearch

public RankSearch()
Method Detail

globalInfo

public String globalInfo()
Returns a string describing this search method

Returns:
a description of the search method suitable for displaying in the explorer/experimenter gui

attributeEvaluatorTipText

public String attributeEvaluatorTipText()
Returns the tip text for this property

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

setAttributeEvaluator

public void setAttributeEvaluator(ASEvaluation newEvaluator)
Set the attribute evaluator to use for generating the ranking.

Parameters:
newEvaluator - the attribute evaluator to use.

getAttributeEvaluator

public ASEvaluation getAttributeEvaluator()
Get the attribute evaluator used to generate the ranking.

Returns:
the evaluator used to generate the ranking.

listOptions

public 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(String[] options)
                throws Exception
Parses a given list of options. Valid options are:

-A

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

getOptions

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

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

resetOptions

protected void resetOptions()
Reset the search method.


search

public int[] search(ASEvaluation ASEval,
                    Instances data)
             throws Exception
Ranks attributes using the specified attribute evaluator and then searches the ranking using the supplied subset evaluator.

Specified by:
search in class ASSearch
Parameters:
data - the training instances.
ASEval - the attribute evaluator to guide the search
Returns:
an array (not necessarily ordered) of selected attribute indexes
Throws:
Exception - if the search can't be completed

toString

public String toString()
returns a description of the search as a String

Overrides:
toString in class Object
Returns:
a description of the search