GenAlg-class {GenAlgo}R Documentation

Class "GenAlg"

Description

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.

Usage

## S4 method for signature 'GenAlg'
as.data.frame(x, row.names=NULL, optional=FALSE, ...)
## S4 method for signature 'GenAlg'
as.matrix(x, ...)
## S4 method for signature 'GenAlg'
summary(object, ...)

Arguments

object

object of class GenAlg

x

object of class GenAlg

row.names

character vector giving the row names for the data frame, or NULL

optional

logical scalar. If TRUE, setting row names and converting column names to syntactic names is optional.

...

extra arguments for generic routines

Objects from the Class

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.

Slots

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.

Methods

as.data.frame

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.

as.matrix

signature(x = "GenAlg"): Converts the GenAlg object into a matrix, following the conventions of as.data.frame.

summary

signature(object = "GenAlg"): Print a summary of the GenAlg object.

Author(s)

Kevin R. Coombes krc@silicovore.com, P. Roebuck proebuck@mdanderson.org

References

David Goldberg.
"Genetic Algorithms in Search, Optimization and Machine Learning."
Addison-Wesley, 1989.

See Also

GenAlg, GenAlg-tools, maha.

Examples

showClass("GenAlg")

[Package GenAlgo version 2.2.0 Index]