|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectweka.attributeSelection.ASSearch
weka.attributeSelection.GreedyStepwise
public class GreedyStepwise
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.
-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
| Constructor Summary | |
|---|---|
GreedyStepwise()
Constructor |
|
| Method Summary | |
|---|---|
java.lang.String |
conservativeForwardSelectionTipText()
Returns the tip text for this property |
java.lang.String |
generateRankingTipText()
Returns the tip text for this property |
int |
getCalculatedNumToSelect()
Gets the calculated number of attributes to retain. |
boolean |
getConservativeForwardSelection()
Gets whether conservative selection has been enabled |
boolean |
getGenerateRanking()
Gets whether ranking has been requested. |
int |
getNumToSelect()
Gets the number of attributes to be retained. |
java.lang.String[] |
getOptions()
Gets the current settings of ReliefFAttributeEval. |
java.lang.String |
getRevision()
Returns the revision string. |
boolean |
getSearchBackwards()
Get whether to search backwards |
java.lang.String |
getStartSet()
Returns a list of attributes (and or attribute ranges) as a String |
double |
getThreshold()
Returns the threshold so that the AttributeSelection module can discard attributes from the ranking. |
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 |
numToSelectTipText()
Returns the tip text for this property |
double[][] |
rankedAttributes()
Produces a ranked list of attributes. |
int[] |
search(ASEvaluation ASEval,
Instances data)
Searches the attribute subset space by forward selection. |
java.lang.String |
searchBackwardsTipText()
Returns the tip text for this property |
void |
setConservativeForwardSelection(boolean c)
Set whether attributes should continue to be added during a forward search as long as merit does not decrease |
void |
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(java.lang.String[] options)
Parses a given list of options. |
void |
setSearchBackwards(boolean back)
Set whether to search backwards instead of forwards |
void |
setStartSet(java.lang.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. |
java.lang.String |
startSetTipText()
Returns the tip text for this property |
java.lang.String |
thresholdTipText()
Returns the tip text for this property |
java.lang.String |
toString()
returns a description of the search. |
| Methods inherited from class weka.attributeSelection.ASSearch |
|---|
forName, makeCopies |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public GreedyStepwise()
| Method Detail |
|---|
public java.lang.String globalInfo()
public java.lang.String searchBackwardsTipText()
public void setSearchBackwards(boolean back)
back - true to search backwardspublic boolean getSearchBackwards()
public java.lang.String thresholdTipText()
public void setThreshold(double threshold)
setThreshold in interface RankedOutputSearchthreshold - the threshold.public double getThreshold()
getThreshold in interface RankedOutputSearchpublic java.lang.String numToSelectTipText()
public void setNumToSelect(int n)
setNumToSelect in interface RankedOutputSearchn - the number of attributes to retainpublic int getNumToSelect()
getNumToSelect in interface RankedOutputSearchpublic int getCalculatedNumToSelect()
getCalculatedNumToSelect in interface RankedOutputSearchpublic java.lang.String generateRankingTipText()
public void setGenerateRanking(boolean doRank)
setGenerateRanking in interface RankedOutputSearchdoRank - true if ranking is requestedpublic boolean getGenerateRanking()
getGenerateRanking in interface RankedOutputSearchpublic java.lang.String startSetTipText()
public void setStartSet(java.lang.String startSet)
throws java.lang.Exception
setStartSet in interface StartSetHandlerstartSet - 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 StartSetHandlerpublic java.lang.String conservativeForwardSelectionTipText()
public void setConservativeForwardSelection(boolean c)
c - true if atts should continue to be attedpublic boolean getConservativeForwardSelection()
public java.util.Enumeration listOptions()
listOptions in interface OptionHandler
public void setOptions(java.lang.String[] options)
throws java.lang.Exception
-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 in interface OptionHandleroptions - the list of options as an array of strings
java.lang.Exception - if an option is not supportedpublic java.lang.String[] getOptions()
getOptions in interface OptionHandlerpublic java.lang.String toString()
toString in class java.lang.Object
public int[] search(ASEvaluation ASEval,
Instances data)
throws java.lang.Exception
search in class ASSearchASEval - the attribute evaluator to guide the searchdata - the training instances.
java.lang.Exception - if the search can't be completed
public double[][] rankedAttributes()
throws java.lang.Exception
rankedAttributes in interface RankedOutputSearchjava.lang.Exception - if something goes wrong.public java.lang.String getRevision()
getRevision in interface RevisionHandlergetRevision in class ASSearch
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||