Description Usage Arguments Value See Also
Perform a standard genetic programming (GP) run. Use geneticProgramming
for
untyped genetic programming or typedGeneticProgramming
for typed genetic
programming runs. The required argument fitnessFunction
must be supplied with
an objective function that assigns a numerical fitness value to an R function. Fitness
values are minimized, i.e. smaller values denote higher/better fitness. If a
multi-objective selectionFunction
is used, fitnessFunction
return a
numerical vector of fitness values. The result of the GP run is a GP result object
containing a GP population of R functions. summary.geneticProgrammingResult
can
be used to create summary views of a GP result object. During the run, restarts are
triggered by the restartCondition
. When a restart is triggered, the restartStrategy
is executed, which returns a new population to replace the current one as well as a list of
elite individuals. These are added to the runs elite list, where fitter individuals replace
individuals with lesser fittness. The runs elite list is always sorted by fitness in
ascending order. Only the first component of a multi-criterial fitness counts in this
sorting. After a GP run, the population is inserted into the elite list. The elite list
is returned as part of the GP result object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | geneticProgramming(fitnessFunction, stopCondition = makeTimeStopCondition(5),
population = NULL, populationSize = 100, eliteSize = ceiling(0.1 *
populationSize), elite = list(), functionSet = mathFunctionSet,
inputVariables = inputVariableSet("x"), constantSet = numericConstantSet,
crossoverFunction = crossover, mutationFunction = NULL,
restartCondition = makeEmptyRestartCondition(),
restartStrategy = makeLocalRestartStrategy(),
searchHeuristic = makeAgeFitnessComplexityParetoGpSearchHeuristic(lambda =
ceiling(0.5 * populationSize)), breedingFitness = function(individual) TRUE,
breedingTries = 50, extinctionPrevention = FALSE, archive = FALSE,
progressMonitor = NULL, verbose = TRUE)
typedGeneticProgramming(fitnessFunction, type,
stopCondition = makeTimeStopCondition(5), population = NULL,
populationSize = 100, eliteSize = ceiling(0.1 * populationSize),
elite = list(), functionSet, inputVariables, constantSet,
crossoverFunction = crossoverTyped, mutationFunction = NULL,
restartCondition = makeEmptyRestartCondition(),
restartStrategy = makeLocalRestartStrategy(populationType = type),
searchHeuristic = makeAgeFitnessComplexityParetoGpSearchHeuristic(),
breedingFitness = function(individual) TRUE, breedingTries = 50,
extinctionPrevention = FALSE, archive = FALSE, progressMonitor = NULL,
verbose = TRUE)
|
fitnessFunction |
In case of a single-objective selection function,
|
type |
The range type of the individual functions. This parameter
only applies to |
stopCondition |
The stop condition for the evolution main loop. See
code |
population |
The GP population to start the run with. If this parameter
is missing, a new GP population of size |
populationSize |
The number of individuals if a population is to be created. |
eliteSize |
The number of elite individuals to keep. Defaults to
|
elite |
The elite list, must be alist of individuals sorted in ascending order by their first fitness component. |
functionSet |
The function set. |
inputVariables |
The input variable set. |
constantSet |
The set of constant factory functions. |
crossoverFunction |
The crossover function. |
mutationFunction |
The mutation function. |
restartCondition |
The restart condition for the evolution main loop. See makeEmptyRestartCondition for details. |
restartStrategy |
The strategy for doing restarts. See makeLocalRestartStrategy for details. |
searchHeuristic |
The search-heuristic (i.e. optimization algorithm) to use
in the search of solutions. See the documentation for |
breedingFitness |
A "breeding" function. This function is applied after
every stochastic operation Op that creates or modifies an individal
(typically, Op is a initialization, mutation, or crossover operation). If
the breeding function returns |
breedingTries |
In case of a boolean |
extinctionPrevention |
When set to |
archive |
If set to |
progressMonitor |
A function of signature
|
verbose |
Whether to print progress messages. |
A genetic programming result object that contains a GP population in the
field population
, as well as metadata describing the run parameters.
summary.geneticProgrammingResult
, symbolicRegression
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.