类 GeneticSearch
java.lang.Object
weka.attributeSelection.ASSearch
weka.attributeSelection.GeneticSearch
- 所有已实现的接口:
Serializable
,StartSetHandler
,OptionHandler
,RevisionHandler
,TechnicalInformationHandler
public class GeneticSearch
extends ASSearch
implements StartSetHandler, OptionHandler, TechnicalInformationHandler
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. BibTeX:
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. BibTeX:
@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 (even number). (default = 20).
-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)
- 版本:
- $Revision: 6759 $
- 作者:
- Mark Hall (mhall@cs.waikato.ac.nz)
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明Returns the tip text for this propertydouble
get the probability of crossoverint
get the number of generationsdouble
get the probability of mutationString[]
Gets the current settings of ReliefFAttributeEval.int
get the size of the populationint
get how often repports are generatedReturns the revision string.int
getSeed()
get the value of the random number generator's seedReturns a list of attributes (and or attribute ranges) as a StringReturns 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.Returns a string describing this search methodReturns an enumeration describing the available options.Returns the tip text for this propertyReturns the tip text for this propertyReturns the tip text for this propertyReturns the tip text for this propertyint[]
search
(ASEvaluation ASEval, Instances data) Searches the attribute subset space using a genetic algorithm.Returns the tip text for this propertyvoid
setCrossoverProb
(double c) set the probability of crossovervoid
setMaxGenerations
(int m) set the number of generations to evaluatevoid
setMutationProb
(double m) set the probability of mutationvoid
setOptions
(String[] options) Parses a given list of options.void
setPopulationSize
(int p) set the population sizevoid
setReportFrequency
(int f) set how often reports are generatedvoid
setSeed
(int s) set the seed for random number generationvoid
setStartSet
(String startSet) Sets a starting set of attributes for the search.Returns the tip text for this propertytoString()
returns a description of the search从类继承的方法 weka.attributeSelection.ASSearch
forName, makeCopies
-
构造器详细资料
-
GeneticSearch
public GeneticSearch()Constructor. Make a new GeneticSearch object
-
-
方法详细资料
-
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:-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 (even number). (default = 20).
-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
在接口中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()
-
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)
-
seedTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setSeed
public void setSeed(int s) set the seed for random number generation- 参数:
s
- seed value
-
getSeed
public int getSeed()get the value of the random number generator's seed- 返回:
- the seed for random number generation
-
reportFrequencyTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setReportFrequency
public void setReportFrequency(int f) set how often reports are generated- 参数:
f
- generate reports every f generations
-
getReportFrequency
public int getReportFrequency()get how often repports are generated- 返回:
- how often reports are generated
-
mutationProbTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setMutationProb
public void setMutationProb(double m) set the probability of mutation- 参数:
m
- the probability for mutation occuring
-
getMutationProb
public double getMutationProb()get the probability of mutation- 返回:
- the probability of mutation occuring
-
crossoverProbTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setCrossoverProb
public void setCrossoverProb(double c) set the probability of crossover- 参数:
c
- the probability that two population members will exchange genetic material
-
getCrossoverProb
public double getCrossoverProb()get the probability of crossover- 返回:
- the probability of crossover
-
maxGenerationsTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setMaxGenerations
public void setMaxGenerations(int m) set the number of generations to evaluate- 参数:
m
- the number of generations
-
getMaxGenerations
public int getMaxGenerations()get the number of generations- 返回:
- the maximum number of generations
-
populationSizeTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setPopulationSize
public void setPopulationSize(int p) set the population size- 参数:
p
- the size of the population
-
getPopulationSize
public int getPopulationSize()get the size of the population- 返回:
- the population size
-
globalInfo
Returns a string describing this search method- 返回:
- a description of the search suitable for displaying in the explorer/experimenter gui
-
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.- 指定者:
getTechnicalInformation
在接口中TechnicalInformationHandler
- 返回:
- the technical information about this class
-
toString
returns a description of the search -
search
Searches the attribute subset space using a genetic algorithm. -
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 覆盖:
getRevision
在类中ASSearch
- 返回:
- the revision
-