Description Usage Arguments Objects from the Class Slots Methods Author(s) References See Also Examples
Objects of the GenAlg
class represent one step (population) in the
evolution of a genetic algorithm. This algorithm has been customized to
perform feature selection for the class prediction problem.
1 2 3 4 5 6 |
object |
object of class |
x |
object of class |
row.names |
character vector giving the row names for the data frame,
or |
optional |
logical scalar. If |
... |
extra arguments for generic routines |
Objects should be created by calls to the GenAlg
generator;
they will also be created automatically as a result of applying the function
newGeneration
to an existing GenAlg
object.
data
:The initial population of potential solutions, in the form of a data matrix with one individual per row.
fitfun
:A function to compute the fitness of an
individual solution. Must take two input arguments: a vector of
indices into the rows of the population matrix, and a context
list within which any other items required by the function can be
resolved. Must return a real number; higher values indicate better
fitness, with the maximum fitness occurring at the optimal solution
to the underlying numerical problem.
mutfun
:A function to mutate individual alleles in the
population. Must take two arguments: the starting allele and a
context
list as in the fitness function.
p.mutation
:numeric scalar between 0
and 1
,
representing the probability that an individual allele will be mutated.
p.crossover
:numeric scalar between 0
and 1
,
representing the probability that crossover will occur during
reproduction.
generation
:integer scalar identifying the current generation.
fitness
:numeric vector containing the fitness of all individuals in the population.
best.fit
:A numeric value; the maximum fitness.
best.individual
:A matrix (often with one row) containing the individual(s) achieving the maximum fitness.
context
:A list of additional data required to perform
mutation or to compute fitness. This list is passed along as the
second argument when fitfun
and mutfun
are called.
signature(x = "GenAlg")
: Converts the
GenAlg
object into a data frame. The first column contains
the fitness ; remaining columns contain three selected features,
given as integer indices into the rows of the original data matrix.
signature(x = "GenAlg")
: Converts the GenAlg
object into a matrix, following the conventions of as.data.frame
.
signature(object = "GenAlg")
: Print a summary
of the GenAlg object.
Kevin R. Coombes krc@silicovore.com, P. Roebuck proebuck@mdanderson.org
David Goldberg.
"Genetic Algorithms in Search, Optimization and Machine Learning."
Addison-Wesley, 1989.
1 | showClass("GenAlg")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.