All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.attributeSelection.Ranker

java.lang.Object
    |
    +----weka.attributeSelection.ASSearch
            |
            +----weka.attributeSelection.Ranker

public class Ranker
extends ASSearch
implements RankedOutputSearch, StartSetHandler, OptionHandler
Class for ranking the attributes evaluated by a AttributeEvaluator Valid options are:

-P
Specify a starting set of attributes. Eg 1,4,7-9.

-T
Specify a threshold by which the AttributeSelection module can.
discard attributes.

Version:
$Revision: 1.17 $
Author:
Mark Hall (mhall@cs.waikato.ac.nz)

Constructor Index

 o Ranker()
Constructor

Method Index

 o generateRankingTipText()
Returns the tip text for this property
 o getCalculatedNumToSelect()
Gets the calculated number to select.
 o getGenerateRanking()
This is a dummy method.
 o getNumToSelect()
Gets the number of attributes to be retained.
 o getOptions()
Gets the current settings of ReliefFAttributeEval.
 o getStartSet()
Returns a list of attributes (and or attribute ranges) as a String
 o getThreshold()
Returns the threshold so that the AttributeSelection module can discard attributes from the ranking.
 o globalInfo()
Returns a string describing this search method
 o listOptions()
Returns an enumeration describing the available options
 o numToSelectTipText()
Returns the tip text for this property
 o rankedAttributes()
Sorts the evaluated attribute list
 o search(ASEvaluation, Instances)
Kind of a dummy search algorithm.
 o setGenerateRanking(boolean)
This is a dummy set method---Ranker is ONLY capable of producing a ranked list of attributes for attribute evaluators.
 o setNumToSelect(int)
Specify the number of attributes to select from the ranked list.
 o setOptions(String[])
Parses a given list of options.
 o setStartSet(String)
Sets a starting set of attributes for the search.
 o setThreshold(double)
Set the threshold by which the AttributeSelection module can discard attributes.
 o startSetTipText()
Returns the tip text for this property
 o thresholdTipText()
Returns the tip text for this property
 o toString()
returns a description of the search as a String

Constructor Detail

 o Ranker
public Ranker()
          Constructor

Method Detail

 o globalInfo
public java.lang.String globalInfo()
          Returns a string describing this search method
Returns:
a description of the search suitable for displaying in the explorer/experimenter gui
 o numToSelectTipText
public java.lang.String numToSelectTipText()
          Returns the tip text for this property
Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui
 o setNumToSelect
public void setNumToSelect(int n)
          Specify the number of attributes to select from the ranked list. -1 indicates that all attributes are to be retained.
Parameters:
n - the number of attributes to retain
 o getNumToSelect
public int getNumToSelect()
          Gets the number of attributes to be retained.
Returns:
the number of attributes to retain
 o getCalculatedNumToSelect
public int getCalculatedNumToSelect()
          Gets the calculated number to select. This might be computed from a threshold, or if < 0 is set as the number to select then it is set to the number of attributes in the (transformed) data.
Returns:
the calculated number of attributes to select
 o thresholdTipText
public java.lang.String thresholdTipText()
          Returns the tip text for this property
Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui
 o setThreshold
public void setThreshold(double threshold)
          Set the threshold by which the AttributeSelection module can discard attributes.
Parameters:
threshold - the threshold.
 o getThreshold
public double getThreshold()
          Returns the threshold so that the AttributeSelection module can discard attributes from the ranking.
 o generateRankingTipText
public java.lang.String generateRankingTipText()
          Returns the tip text for this property
Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui
 o setGenerateRanking
public void setGenerateRanking(boolean doRank)
          This is a dummy set method---Ranker is ONLY capable of producing a ranked list of attributes for attribute evaluators.
Parameters:
doRank - this parameter is N/A and is ignored
 o getGenerateRanking
public boolean getGenerateRanking()
          This is a dummy method. Ranker can ONLY be used with attribute evaluators and as such can only produce a ranked list of attributes
Returns:
true all the time.
 o startSetTipText
public java.lang.String startSetTipText()
          Returns the tip text for this property
Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui
 o setStartSet
public void setStartSet(java.lang.String startSet) throws java.lang.Exception
          Sets a starting set of attributes for the search. It is the search method's responsibility to report this start set (if any) in its toString() method.
Parameters:
startSet - a string containing a list of attributes (and or ranges), eg. 1,2,6,10-15.
Throws:
java.lang.Exception - if start set can't be set.
 o getStartSet
public java.lang.String getStartSet()
          Returns a list of attributes (and or attribute ranges) as a String
Returns:
a list of attributes (and or attribute ranges)
 o listOptions
public java.util.Enumeration listOptions()
          Returns an enumeration describing the available options
Returns:
an enumeration of all the available options
 o setOptions
public void setOptions(java.lang.String options[]) throws java.lang.Exception
          Parses a given list of options. Valid options are:

-P
Specify a starting set of attributes. Eg 1,4,7-9.

-T
Specify a threshold by which the AttributeSelection module can
discard attributes.

-N
Specify the number of attributes to retain. Overides any threshold.

Parameters:
options - the list of options as an array of strings
Throws:
java.lang.Exception - if an option is not supported
 o getOptions
public java.lang.String[] getOptions()
          Gets the current settings of ReliefFAttributeEval.
Returns:
an array of strings suitable for passing to setOptions()
 o search
public int[] search(ASEvaluation ASEval,
                    Instances data) throws java.lang.Exception
          Kind of a dummy search algorithm. Calls a Attribute evaluator to evaluate each attribute not included in the startSet and then sorts them to produce a ranked list of attributes.
Parameters:
ASEvaluator - the attribute evaluator to guide the search
data - the training instances.
Returns:
an array (not necessarily ordered) of selected attribute indexes
Throws:
java.lang.Exception - if the search can't be completed
Overrides:
search in class ASSearch
 o rankedAttributes
public double[][] rankedAttributes() throws java.lang.Exception
          Sorts the evaluated attribute list
Returns:
an array of sorted (highest eval to lowest) attribute indexes
Throws:
java.lang.Exception - of sorting can't be done.
 o toString
public java.lang.String toString()
          returns a description of the search as a String
Returns:
a description of the search
Overrides:
toString in class java.lang.Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home