Learn R Programming

GAparsimony (version 0.9.5)

parsimony_rerank: Function for reranking by complexity in parsimonious model selection process

Description

Promotes models with similar fitness but lower complexity to top positions.

Usage

parsimony_rerank(object, verbose=FALSE, ...)

Value

Return a vector with the new position of the individuals.

Arguments

object

An object of class "ga_parsimony" resulting from a call to function ga_parsimony with keep_history parameter set to TRUE.

verbose

If it is TRUE shows additional information.

...

Further arguments passed to or from other methods.

Author

Francisco Javier Martinez de Pison. fjmartin@unirioja.es. EDMANS Group. https://edmans.webs.com/

Details

This method corresponds with the second step of parsimonious model selection (PMS) procedure. PMS works in the following way: in each GA generation, best solutions are first sorted by their cost, J. Then, in a second step, individuals with less complexity are moved to the top positions when the absolute difference of their J is lower than a object@rerank_error threshold value. Therefore, the selection of less complex solutions among those with similar accuracy promotes the evolution of robust solutions with better generalization capabilities.

See Also

ga_parsimony

Examples

Run this code
library(GAparsimony)
object <- new("ga_parsimony", 
              rerank_error=0.2,
              best_score = 2.0,
              popSize = 4, 
              fitnessval = c(2.0, 1.9, 1.1, 1.0), 
              complexity=c(2,1,2,1))

pop_ini <- data.frame(fitnessval=object@fitnessval, 
                      complexity=object@complexity)
print("INITIAL POPULATION:")
print(pop_ini)

print("POPULATION ORDERED BY COMPLEXITY")
print(paste0("WHEN abs(diff(fitnessval)) < ",
             object@rerank_error,":"))
pop_ini[parsimony_rerank(object),]

Run the code above in your browser using DataLab