Package weka.attributeSelection

# Class RankSearch

java.lang.Object
weka.attributeSelection.ASSearch
weka.attributeSelection.RankSearch

All Implemented Interfaces:
  `Serializable`, `OptionHandler`, `RevisionHandler`, `TechnicalInformationHandler`

public class RankSearch extends ASSearch implements OptionHandler, TechnicalInformationHandler
RankSearch :
Uses an attribute/subset evaluator to rank all attributes. If a subset evaluator is specified, then a forward selection search is used to generate a ranked list. From the ranked list of attributes, subsets of increasing size are evaluated, ie. The best attribute, the best attribute plus the next best attribute, etc.... The best attribute set is reported. RankSearch is linear in the number of attributes if a simple attribute evaluator is used such as GainRatioAttributeEval. For more information see:
Mark Hall, Geoffrey Holmes (2003). Benchmarking attribute selection techniques for discrete class data mining. IEEE Transactions on Knowledge and Data Engineering. 15(6):1437-1447.

Valid options are:

     -A <attribute evaluator>
      class name of attribute evaluator to use for ranking. Place any
      evaluator options LAST on the command line following a "--".
      eg.:
       -A weka.attributeSelection.GainRatioAttributeEval ... -- -M
      (default: weka.attributeSelection.GainRatioAttributeEval)

     -S <step size>
      number of attributes to be added from the
      ranking in each iteration (default = 1).

     -R <start point>
      point in the ranking to start evaluating from.
      (default = 0, ie. the head of the ranking).

     Options specific to evaluator weka.attributeSelection.GainRatioAttributeEval:

     -M
      treat missing values as a seperate value.

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

## Constructor Summary

Constructors
Constructor
Description
`RankSearch()`
Constructor

## Method Summary

Modifier and Type
Method
Description
`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`
`getRevision()`
Returns the revision string.
`int`
`getStartPoint()`
Get the point at which to start evaluating the ranking
`int`
`getStepSize()`
Get the number of attributes to add from the rankining in each iteration
`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.
`String`
`globalInfo()`
Returns a string describing this search method
`Enumeration`
`listOptions()`
Returns an enumeration describing the available options.
`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.
`void`
`setStartPoint(int sp)`
Set the point at which to start evaluating the ranking
`void`
`setStepSize(int ss)`
Set the number of attributes to add from the rankining in each iteration
`String`
`startPointTipText()`
Returns the tip text for this property
`String`
`stepSizeTipText()`
Returns the tip text for this property
`String`
`toString()`
returns a description of the search as a String

### Methods inherited from class weka.attributeSelection.ASSearch

`forName, makeCopies`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### RankSearch

public RankSearch()
Constructor

## Method Details

### 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

### 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

### 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.

### stepSizeTipText

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

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

### setStepSize

public void setStepSize(int ss)
Set the number of attributes to add from the rankining in each iteration

Parameters:
  `ss` - the number of attribes to add.

### getStepSize

public int getStepSize()
Get the number of attributes to add from the rankining in each iteration

Returns:
  the number of attributes to add.

### startPointTipText

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

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

### setStartPoint

public void setStartPoint(int sp)
Set the point at which to start evaluating the ranking

Parameters:
  `sp` - the position in the ranking to start at

### getStartPoint

public int getStartPoint()
Get the point at which to start evaluating the ranking

Returns:
  the position in the ranking to start at

### 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 <attribute evaluator>
      class name of attribute evaluator to use for ranking. Place any
      evaluator options LAST on the command line following a "--".
      eg.:
       -A weka.attributeSelection.GainRatioAttributeEval ... -- -M
      (default: weka.attributeSelection.GainRatioAttributeEval)

     -S <step size>
      number of attributes to be added from the
      ranking in each iteration (default = 1).

     -R <start point>
      point in the ranking to start evaluating from.
      (default = 0, ie. the head of the ranking).

     Options specific to evaluator weka.attributeSelection.GainRatioAttributeEval:

     -M
      treat missing values as a seperate value.

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()

### 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:
  `ASEval` - the subset evaluator to guide the search
  `data` - the training instances.
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

### getRevision

public String getRevision()
Returns the revision string.

Specified by:
  `getRevision` in interface `RevisionHandler`
Overrides:
  `getRevision` in class `ASSearch`
Returns:
  the revision