类 BestFirst

java.lang.Object
weka.attributeSelection.ASSearch
weka.attributeSelection.BestFirst
所有已实现的接口:
Serializable, StartSetHandler, OptionHandler, RevisionHandler

public class BestFirst extends ASSearch implements OptionHandler, StartSetHandler
BestFirst:

Searches the space of attribute subsets by greedy hillclimbing augmented with a backtracking facility. Setting the number of consecutive non-improving nodes allowed controls the level of backtracking done. Best first may start with the empty set of attributes and search forward, or start with the full set of attributes and search backward, or start at any point and search in both directions (by considering all possible single attribute additions and deletions at a given point).

Valid options are:

 -P <start set>
  Specify a starting set of attributes.
  Eg. 1,3,5-7.
 -D <0 = backward | 1 = forward | 2 = bi-directional>
  Direction of search. (default = 1).
 -N <num>
  Number of non-improving nodes to
  consider before terminating search.
 -S <num>
  Size of lookup cache for evaluated subsets.
  Expressed as a multiple of the number of
  attributes in the data set. (default = 1)
版本:
$Revision: 1.29 $
作者:
Mark Hall (mhall@cs.waikato.ac.nz) Martin Guetlein (cashing merit of expanded nodes)
另请参阅:
  • 字段详细资料

    • TAGS_SELECTION

      public static final Tag[] TAGS_SELECTION
      search directions
  • 构造器详细资料

    • BestFirst

      public BestFirst()
      Constructor
  • 方法详细资料

    • globalInfo

      public String globalInfo()
      Returns a string describing this search method
      返回:
      a description of the search method suitable for displaying in the explorer/experimenter gui
    • listOptions

      public Enumeration listOptions()
      Returns an enumeration describing the available options.
      指定者:
      listOptions 在接口中 OptionHandler
      返回:
      an enumeration of all the available options.
    • setOptions

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

      Valid options are:

       -P <start set>
        Specify a starting set of attributes.
        Eg. 1,3,5-7.
       -D <0 = backward | 1 = forward | 2 = bi-directional>
        Direction of search. (default = 1).
       -N <num>
        Number of non-improving nodes to
        consider before terminating search.
       -S <num>
        Size of lookup cache for evaluated subsets.
        Expressed as a multiple of the number of
        attributes in the data set. (default = 1)
      指定者:
      setOptions 在接口中 OptionHandler
      参数:
      options - the list of options as an array of strings
      抛出:
      Exception - if an option is not supported
    • setLookupCacheSize

      public void setLookupCacheSize(int size)
      Set the maximum size of the evaluated subset cache (hashtable). This is expressed as a multiplier for the number of attributes in the data set. (default = 1).
      参数:
      size - the maximum size of the hashtable
    • getLookupCacheSize

      public int getLookupCacheSize()
      Return the maximum size of the evaluated subset cache (expressed as a multiplier for the number of attributes in a data set.
      返回:
      the maximum size of the hashtable.
    • lookupCacheSizeTipText

      public String lookupCacheSizeTipText()
      Returns the tip text for this property
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • startSetTipText

      public String startSetTipText()
      Returns the tip text for this property
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • setStartSet

      public void setStartSet(String startSet) throws 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.
      指定者:
      setStartSet 在接口中 StartSetHandler
      参数:
      startSet - a string containing a list of attributes (and or ranges), eg. 1,2,6,10-15.
      抛出:
      Exception - if start set can't be set.
    • getStartSet

      public String getStartSet()
      Returns a list of attributes (and or attribute ranges) as a String
      指定者:
      getStartSet 在接口中 StartSetHandler
      返回:
      a list of attributes (and or attribute ranges)
    • searchTerminationTipText

      public String searchTerminationTipText()
      Returns the tip text for this property
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • setSearchTermination

      public void setSearchTermination(int t) throws Exception
      Set the numnber of non-improving nodes to consider before terminating search.
      参数:
      t - the number of non-improving nodes
      抛出:
      Exception - if t is less than 1
    • getSearchTermination

      public int getSearchTermination()
      Get the termination criterion (number of non-improving nodes).
      返回:
      the number of non-improving nodes
    • directionTipText

      public String directionTipText()
      Returns the tip text for this property
      返回:
      tip text for this property suitable for displaying in the explorer/experimenter gui
    • setDirection

      public void setDirection(SelectedTag d)
      Set the search direction
      参数:
      d - the direction of the search
    • getDirection

      public SelectedTag getDirection()
      Get the search direction
      返回:
      the direction of the search
    • getOptions

      public String[] getOptions()
      Gets the current settings of BestFirst.
      指定者:
      getOptions 在接口中 OptionHandler
      返回:
      an array of strings suitable for passing to setOptions()
    • toString

      public String toString()
      returns a description of the search as a String
      覆盖:
      toString 在类中 Object
      返回:
      a description of the search
    • search

      public int[] search(ASEvaluation ASEval, Instances data) throws Exception
      Searches the attribute subset space by best first search
      指定者:
      search 在类中 ASSearch
      参数:
      ASEval - the attribute evaluator to guide the search
      data - the training instances.
      返回:
      an array (not necessarily ordered) of selected attribute indexes
      抛出:
      Exception - if the search can't be completed
    • getRevision

      public String getRevision()
      Returns the revision string.
      指定者:
      getRevision 在接口中 RevisionHandler
      覆盖:
      getRevision 在类中 ASSearch
      返回:
      the revision