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

Class weka.attributeSelection.BestFirst

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

public class BestFirst
extends ASSearch
implements OptionHandler, StartSetHandler
Class for performing a best first search.

Valid options are:

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

-D <-1 = backward | 0 = bidirectional | 1 = forward>
Direction of the search. (default = 1).

-N
Number of non improving nodes to consider before terminating search. (default = 5).

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

Class Index

 o BestFirst.Link2
Class for a node in a linked list.
 o BestFirst.LinkedList2
Class for handling a linked list.

Variable Index

 o TAGS_SELECTION
 

Constructor Index

 o BestFirst()
Constructor

Method Index

 o directionTipText()
Returns the tip text for this property
 o getDirection()
Get the search direction
 o getOptions()
Gets the current settings of BestFirst.
 o getSearchTermination()
Get the termination criterion (number of non-improving nodes).
 o getStartSet()
Returns a list of attributes (and or attribute ranges) as a String
 o globalInfo()
Returns a string describing this search method
 o listOptions()
Returns an enumeration describing the available options
 o search(ASEvaluation, Instances)
Searches the attribute subset space by best first search
 o searchTerminationTipText()
Returns the tip text for this property
 o setDirection(SelectedTag)
Set the search direction
 o setOptions(String[])
Parses a given list of options.
 o setSearchTermination(int)
Set the numnber of non-improving nodes to consider before terminating search.
 o setStartSet(String)
Sets a starting set of attributes for the search.
 o startSetTipText()
Returns the tip text for this property
 o toString()
returns a description of the search as a String

Field Detail

 o TAGS_SELECTION
public static final Tag[] TAGS_SELECTION

Constructor Detail

 o BestFirst
public BestFirst()
          Constructor

Method Detail

 o globalInfo
public java.lang.String globalInfo()
          Returns a string describing this search method
Returns:
a description of the search method suitable for displaying in the explorer/experimenter gui
 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.

-D <-1 = backward | 0 = bidirectional | 1 = forward>
Direction of the search. (default = 1).

-N
Number of non improving nodes to consider before terminating search. (default = 5).

Parameters:
options - the list of options as an array of strings
Throws:
java.lang.Exception - if an option is not supported
 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 searchTerminationTipText
public java.lang.String searchTerminationTipText()
          Returns the tip text for this property
Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui
 o setSearchTermination
public void setSearchTermination(int t) throws java.lang.Exception
          Set the numnber of non-improving nodes to consider before terminating search.
Parameters:
t - the number of non-improving nodes
Throws:
java.lang.Exception - if t is less than 1
 o getSearchTermination
public int getSearchTermination()
          Get the termination criterion (number of non-improving nodes).
Returns:
the number of non-improving nodes
 o directionTipText
public java.lang.String directionTipText()
          Returns the tip text for this property
Returns:
tip text for this property suitable for displaying in the explorer/experimenter gui
 o setDirection
public void setDirection(SelectedTag d)
          Set the search direction
Parameters:
d - the direction of the search
 o getDirection
public SelectedTag getDirection()
          Get the search direction
Returns:
the direction of the search
 o getOptions
public java.lang.String[] getOptions()
          Gets the current settings of BestFirst.
Returns:
an array of strings suitable for passing to setOptions()
 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
 o search
public int[] search(ASEvaluation ASEval,
                    Instances data) throws java.lang.Exception
          Searches the attribute subset space by best first search
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

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