|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.attributeSelection.ASSearch
weka.attributeSelection.BestFirst
public class BestFirst
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).
-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)
Nested Class Summary | |
---|---|
class |
BestFirst.Link2
Class for a node in a linked list. |
class |
BestFirst.LinkedList2
Class for handling a linked list. |
Field Summary | |
---|---|
static Tag[] |
TAGS_SELECTION
search directions |
Constructor Summary | |
---|---|
BestFirst()
Constructor |
Method Summary | |
---|---|
java.lang.String |
directionTipText()
Returns the tip text for this property |
SelectedTag |
getDirection()
Get the search direction |
int |
getLookupCacheSize()
Return the maximum size of the evaluated subset cache (expressed as a multiplier for the number of attributes in a data set. |
java.lang.String[] |
getOptions()
Gets the current settings of BestFirst. |
int |
getSearchTermination()
Get the termination criterion (number of non-improving nodes). |
java.lang.String |
getStartSet()
Returns a list of attributes (and or attribute ranges) as a String |
java.lang.String |
globalInfo()
Returns a string describing this search method |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options. |
java.lang.String |
lookupCacheSizeTipText()
Returns the tip text for this property |
int[] |
search(ASEvaluation ASEval,
Instances data)
Searches the attribute subset space by best first search |
java.lang.String |
searchTerminationTipText()
Returns the tip text for this property |
void |
setDirection(SelectedTag d)
Set the search direction |
void |
setLookupCacheSize(int size)
Set the maximum size of the evaluated subset cache (hashtable). |
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
void |
setSearchTermination(int t)
Set the numnber of non-improving nodes to consider before terminating search. |
void |
setStartSet(java.lang.String startSet)
Sets a starting set of attributes for the search. |
java.lang.String |
startSetTipText()
Returns the tip text for this property |
java.lang.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 |
Field Detail |
---|
public static final Tag[] TAGS_SELECTION
Constructor Detail |
---|
public BestFirst()
Method Detail |
---|
public java.lang.String globalInfo()
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-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
in interface OptionHandler
options
- the list of options as an array of strings
java.lang.Exception
- if an option is not supportedpublic void setLookupCacheSize(int size)
size
- the maximum size of the hashtablepublic int getLookupCacheSize()
public java.lang.String lookupCacheSizeTipText()
public java.lang.String startSetTipText()
public void setStartSet(java.lang.String startSet) throws java.lang.Exception
setStartSet
in interface StartSetHandler
startSet
- a string containing a list of attributes (and or ranges),
eg. 1,2,6,10-15.
java.lang.Exception
- if start set can't be set.public java.lang.String getStartSet()
getStartSet
in interface StartSetHandler
public java.lang.String searchTerminationTipText()
public void setSearchTermination(int t) throws java.lang.Exception
t
- the number of non-improving nodes
java.lang.Exception
- if t is less than 1public int getSearchTermination()
public java.lang.String directionTipText()
public void setDirection(SelectedTag d)
d
- the direction of the searchpublic SelectedTag getDirection()
public java.lang.String[] getOptions()
getOptions
in interface OptionHandler
public java.lang.String toString()
toString
in class java.lang.Object
public int[] search(ASEvaluation ASEval, Instances data) throws java.lang.Exception
search
in class ASSearch
ASEval
- the attribute evaluator to guide the searchdata
- the training instances.
java.lang.Exception
- if the search can't be completed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |