类 GreedyStepwise
java.lang.Object
weka.attributeSelection.ASSearch
weka.attributeSelection.GreedyStepwise
public class GreedyStepwise
extends ASSearch
implements RankedOutputSearch, StartSetHandler, OptionHandler
GreedyStepwise :
Performs a greedy forward or backward search through the space of attribute subsets. May start with no/all attributes or from an arbitrary point in the space. Stops when the addition/deletion of any remaining attributes results in a decrease in evaluation. Can also produce a ranked list of attributes by traversing the space from one side to the other and recording the order that attributes are selected.
Valid options are:
Performs a greedy forward or backward search through the space of attribute subsets. May start with no/all attributes or from an arbitrary point in the space. Stops when the addition/deletion of any remaining attributes results in a decrease in evaluation. Can also produce a ranked list of attributes by traversing the space from one side to the other and recording the order that attributes are selected.
Valid options are:
-C Use conservative forward search
-B Use a backward search instead of a forward one.
-P <start set> Specify a starting set of attributes. Eg. 1,3,5-7.
-R Produce a ranked list of attributes.
-T <threshold> Specify a theshold by which attributes may be discarded from the ranking. Use in conjuction with -R
-N <num to select> Specify number of attributes to select
- 版本:
- $Revision: 11229 $
- 作者:
- Mark Hall
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明Returns the tip text for this propertyReturns the tip text for this propertyint
Gets the calculated number of attributes to retain.boolean
Gets whether conservative selection has been enabledboolean
Gets whether ranking has been requested.int
Gets the number of attributes to be retained.String[]
Gets the current settings of ReliefFAttributeEval.Returns the revision string.boolean
Get whether to search backwardsReturns a list of attributes (and or attribute ranges) as a Stringdouble
Returns the threshold so that the AttributeSelection module can discard attributes from the ranking.Returns a string describing this search methodReturns an enumeration describing the available options.Returns the tip text for this propertydouble[][]
Produces a ranked list of attributes.int[]
search
(ASEvaluation ASEval, Instances data) Searches the attribute subset space by forward selection.Returns the tip text for this propertyvoid
setConservativeForwardSelection
(boolean c) Set whether attributes should continue to be added during a forward search as long as merit does not decreasevoid
setGenerateRanking
(boolean doRank) Records whether the user has requested a ranked list of attributes.void
setNumToSelect
(int n) Specify the number of attributes to select from the ranked list (if generating a ranking).void
setOptions
(String[] options) Parses a given list of options.void
setSearchBackwards
(boolean back) Set whether to search backwards instead of forwardsvoid
setStartSet
(String startSet) Sets a starting set of attributes for the search.void
setThreshold
(double threshold) Set the threshold by which the AttributeSelection module can discard attributes.Returns the tip text for this propertyReturns the tip text for this propertytoString()
returns a description of the search.从类继承的方法 weka.attributeSelection.ASSearch
forName, makeCopies
-
构造器详细资料
-
GreedyStepwise
public GreedyStepwise()Constructor
-
-
方法详细资料
-
globalInfo
Returns a string describing this search method- 返回:
- a description of the search suitable for displaying in the explorer/experimenter gui
-
searchBackwardsTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setSearchBackwards
public void setSearchBackwards(boolean back) Set whether to search backwards instead of forwards- 参数:
back
- true to search backwards
-
getSearchBackwards
public boolean getSearchBackwards()Get whether to search backwards- 返回:
- true if the search will proceed backwards
-
thresholdTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setThreshold
public void setThreshold(double threshold) Set the threshold by which the AttributeSelection module can discard attributes.- 指定者:
setThreshold
在接口中RankedOutputSearch
- 参数:
threshold
- the threshold.
-
getThreshold
public double getThreshold()Returns the threshold so that the AttributeSelection module can discard attributes from the ranking.- 指定者:
getThreshold
在接口中RankedOutputSearch
- 返回:
- a threshold by which to discard attributes
-
numToSelectTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setNumToSelect
public void setNumToSelect(int n) Specify the number of attributes to select from the ranked list (if generating a ranking). -1 indicates that all attributes are to be retained.- 指定者:
setNumToSelect
在接口中RankedOutputSearch
- 参数:
n
- the number of attributes to retain
-
getNumToSelect
public int getNumToSelect()Gets the number of attributes to be retained.- 指定者:
getNumToSelect
在接口中RankedOutputSearch
- 返回:
- the number of attributes to retain
-
getCalculatedNumToSelect
public int getCalculatedNumToSelect()Gets the calculated number of attributes to retain. This is the actual number of attributes to retain. This is the same as getNumToSelect if the user specifies a number which is not less than zero. Otherwise it should be the number of attributes in the (potentially transformed) data.- 指定者:
getCalculatedNumToSelect
在接口中RankedOutputSearch
-
generateRankingTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setGenerateRanking
public void setGenerateRanking(boolean doRank) Records whether the user has requested a ranked list of attributes.- 指定者:
setGenerateRanking
在接口中RankedOutputSearch
- 参数:
doRank
- true if ranking is requested
-
getGenerateRanking
public boolean getGenerateRanking()Gets whether ranking has been requested. This is used by the AttributeSelection module to determine if rankedAttributes() should be called.- 指定者:
getGenerateRanking
在接口中RankedOutputSearch
- 返回:
- true if ranking has been requested.
-
startSetTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setStartSet
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
Returns a list of attributes (and or attribute ranges) as a String- 指定者:
getStartSet
在接口中StartSetHandler
- 返回:
- a list of attributes (and or attribute ranges)
-
conservativeForwardSelectionTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setConservativeForwardSelection
public void setConservativeForwardSelection(boolean c) Set whether attributes should continue to be added during a forward search as long as merit does not decrease- 参数:
c
- true if atts should continue to be atted
-
getConservativeForwardSelection
public boolean getConservativeForwardSelection()Gets whether conservative selection has been enabled- 返回:
- true if conservative forward selection is enabled
-
listOptions
Returns an enumeration describing the available options.- 指定者:
listOptions
在接口中OptionHandler
- 返回:
- an enumeration of all the available options.
-
setOptions
Parses a given list of options. Valid options are:-C Use conservative forward search
-B Use a backward search instead of a forward one.
-P <start set> Specify a starting set of attributes. Eg. 1,3,5-7.
-R Produce a ranked list of attributes.
-T <threshold> Specify a theshold by which attributes may be discarded from the ranking. Use in conjuction with -R
-N <num to select> Specify number of attributes to select
- 指定者:
setOptions
在接口中OptionHandler
- 参数:
options
- the list of options as an array of strings- 抛出:
Exception
- if an option is not supported
-
getOptions
Gets the current settings of ReliefFAttributeEval.- 指定者:
getOptions
在接口中OptionHandler
- 返回:
- an array of strings suitable for passing to setOptions()
-
toString
returns a description of the search. -
search
Searches the attribute subset space by forward selection. -
rankedAttributes
Produces a ranked list of attributes. Search must have been performed prior to calling this function. Search is called by this function to complete the traversal of the the search space. A list of attributes and merits are returned. The attributes a ranked by the order they are added to the subset during a forward selection search. Individual merit values reflect the merit associated with adding the corresponding attribute to the subset; because of this, merit values may initially increase but then decrease as the best subset is "passed by" on the way to the far side of the search space.- 指定者:
rankedAttributes
在接口中RankedOutputSearch
- 返回:
- an array of attribute indexes and associated merit values
- 抛出:
Exception
- if something goes wrong.
-
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 覆盖:
getRevision
在类中ASSearch
- 返回:
- the revision
-