|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.attributeSelection.ASSearch
weka.attributeSelection.GeneticSearch
public class GeneticSearch
GeneticSearch:
Performs a search using the simple genetic algorithm described in Goldberg (1989).
For more information see:
David E. Goldberg (1989). Genetic algorithms in search, optimization and machine learning. Addison-Wesley.
@book{Goldberg1989, author = {David E. Goldberg}, publisher = {Addison-Wesley}, title = {Genetic algorithms in search, optimization and machine learning}, year = {1989}, ISBN = {0201157675} }Valid options are:
-P <start set> Specify a starting set of attributes. Eg. 1,3,5-7.If supplied, the starting set becomes one member of the initial random population.
-Z <population size> Set the size of the population. (default = 10).
-G <number of generations> Set the number of generations. (default = 20)
-C <probability of crossover> Set the probability of crossover. (default = 0.6)
-M <probability of mutation> Set the probability of mutation. (default = 0.033)
-R <report frequency> Set frequency of generation reports. e.g, setting the value to 5 will report every 5th generation (default = number of generations)
-S <seed> Set the random number seed. (default = 1)
Constructor Summary | |
---|---|
GeneticSearch()
Constructor. |
Method Summary | |
---|---|
java.lang.String |
crossoverProbTipText()
Returns the tip text for this property |
double |
getCrossoverProb()
get the probability of crossover |
int |
getMaxGenerations()
get the number of generations |
double |
getMutationProb()
get the probability of mutation |
java.lang.String[] |
getOptions()
Gets the current settings of ReliefFAttributeEval. |
int |
getPopulationSize()
get the size of the population |
int |
getReportFrequency()
get how often repports are generated |
java.lang.String |
getRevision()
Returns the revision string. |
int |
getSeed()
get the value of the random number generator's seed |
java.lang.String |
getStartSet()
Returns a list of attributes (and or attribute ranges) as a String |
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. |
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 |
maxGenerationsTipText()
Returns the tip text for this property |
java.lang.String |
mutationProbTipText()
Returns the tip text for this property |
java.lang.String |
populationSizeTipText()
Returns the tip text for this property |
java.lang.String |
reportFrequencyTipText()
Returns the tip text for this property |
int[] |
search(ASEvaluation ASEval,
Instances data)
Searches the attribute subset space using a genetic algorithm. |
java.lang.String |
seedTipText()
Returns the tip text for this property |
void |
setCrossoverProb(double c)
set the probability of crossover |
void |
setMaxGenerations(int m)
set the number of generations to evaluate |
void |
setMutationProb(double m)
set the probability of mutation |
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
void |
setPopulationSize(int p)
set the population size |
void |
setReportFrequency(int f)
set how often reports are generated |
void |
setSeed(int s)
set the seed for random number generation |
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 |
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 GeneticSearch()
Method Detail |
---|
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.If supplied, the starting set becomes one member of the initial random population.
-Z <population size> Set the size of the population. (default = 10).
-G <number of generations> Set the number of generations. (default = 20)
-C <probability of crossover> Set the probability of crossover. (default = 0.6)
-M <probability of mutation> Set the probability of mutation. (default = 0.033)
-R <report frequency> Set frequency of generation reports. e.g, setting the value to 5 will report every 5th generation (default = number of generations)
-S <seed> Set the random number seed. (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 java.lang.String[] getOptions()
getOptions
in interface OptionHandler
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 seedTipText()
public void setSeed(int s)
s
- seed valuepublic int getSeed()
public java.lang.String reportFrequencyTipText()
public void setReportFrequency(int f)
f
- generate reports every f generationspublic int getReportFrequency()
public java.lang.String mutationProbTipText()
public void setMutationProb(double m)
m
- the probability for mutation occuringpublic double getMutationProb()
public java.lang.String crossoverProbTipText()
public void setCrossoverProb(double c)
c
- the probability that two population members will exchange
genetic materialpublic double getCrossoverProb()
public java.lang.String maxGenerationsTipText()
public void setMaxGenerations(int m)
m
- the number of generationspublic int getMaxGenerations()
public java.lang.String populationSizeTipText()
public void setPopulationSize(int p)
p
- the size of the populationpublic int getPopulationSize()
public java.lang.String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface TechnicalInformationHandler
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 completedpublic java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class ASSearch
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |