public class RandomSearch
extends weka.attributeSelection.ASSearch
implements weka.attributeSelection.StartSetHandler, weka.core.OptionHandler, weka.core.TechnicalInformationHandler
@inproceedings{Liu1996, author = {H. Liu and R. Setiono}, booktitle = {13th International Conference on Machine Learning}, pages = {319-327}, title = {A probabilistic approach to feature selection - A filter solution}, year = {1996} }Valid options are:
-P <start set> Specify a starting set of attributes. Eg. 1,3,5-7. If a start point is supplied, random search evaluates the start point and then randomly looks for subsets that are as good as or better than the start point with the same or lower cardinality.
-F <percent> Percent of search space to consider. (default = 25%).
-V Output subsets as the search progresses. (default = false).
-seed <num> Random seed (default = 1)
Constructor and Description |
---|
RandomSearch()
Constructor
|
Modifier and Type | Method and Description |
---|---|
java.lang.String[] |
getOptions()
Gets the current settings of RandomSearch.
|
java.lang.String |
getRevision()
Returns the revision string.
|
double |
getSearchPercent()
get the percentage of the search space to consider
|
int |
getSeed() |
java.lang.String |
getStartSet()
Returns a list of attributes (and or attribute ranges) as a String
|
weka.core.TechnicalInformation |
getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing detailed
information about the technical background of this class, e.g., paper
reference or book this class is based on.
|
boolean |
getVerbose()
get whether or not output is verbose
|
java.lang.String |
globalInfo()
Returns a string describing this search method
|
java.util.Enumeration<weka.core.Option> |
listOptions()
Returns an enumeration describing the available options.
|
int[] |
search(weka.attributeSelection.ASEvaluation ASEval,
weka.core.Instances data)
Searches the attribute subset space randomly.
|
java.lang.String |
searchPercentTipText()
Returns the tip text for this property
|
java.lang.String |
seedTipText()
Returns the tip text for this property
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setSearchPercent(double p)
set the percentage of the search space to consider
|
void |
setSeed(int seed) |
void |
setStartSet(java.lang.String startSet)
Sets a starting set of attributes for the search.
|
void |
setVerbose(boolean v)
set whether or not to output new best subsets as the search proceeds
|
java.lang.String |
startSetTipText()
Returns the tip text for this property
|
java.lang.String |
toString()
prints a description of the search
|
java.lang.String |
verboseTipText()
Returns the tip text for this property
|
public java.lang.String globalInfo()
public weka.core.TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface weka.core.TechnicalInformationHandler
public java.util.Enumeration<weka.core.Option> listOptions()
listOptions
in interface weka.core.OptionHandler
listOptions
in class weka.attributeSelection.ASSearch
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. If a start point is supplied, random search evaluates the start point and then randomly looks for subsets that are as good as or better than the start point with the same or lower cardinality.
-F <percent> Percent of search space to consider. (default = 25%).
-V Output subsets as the search progresses. (default = false).
setOptions
in interface weka.core.OptionHandler
setOptions
in class weka.attributeSelection.ASSearch
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface weka.core.OptionHandler
getOptions
in class weka.attributeSelection.ASSearch
public java.lang.String startSetTipText()
public void setStartSet(java.lang.String startSet) throws java.lang.Exception
setStartSet
in interface weka.attributeSelection.StartSetHandler
startSet
- a string containing a list of attributes (and or ranges),
eg. 1,2,6,10-15. "" indicates no start point. If a start point is
supplied, random search evaluates the start point and then looks
for subsets that are as good as or better than the start point
with the same or lower cardinality.java.lang.Exception
- if start set can't be set.public java.lang.String getStartSet()
getStartSet
in interface weka.attributeSelection.StartSetHandler
public java.lang.String verboseTipText()
public void setVerbose(boolean v)
v
- true if output is to be verbosepublic boolean getVerbose()
public java.lang.String searchPercentTipText()
public void setSearchPercent(double p)
p
- percent of the search space ( 0 < p <= 100)public double getSearchPercent()
public java.lang.String seedTipText()
public void setSeed(int seed)
public int getSeed()
public java.lang.String toString()
toString
in class java.lang.Object
public int[] search(weka.attributeSelection.ASEvaluation ASEval, weka.core.Instances data) throws java.lang.Exception
search
in class weka.attributeSelection.ASSearch
ASEval
- the attribute evaluator to guide the searchdata
- the training instances.java.lang.Exception
- if the search can't be completedpublic java.lang.String getRevision()
getRevision
in interface weka.core.RevisionHandler
getRevision
in class weka.attributeSelection.ASSearch