View source: R/parsimony_functions.R
| parsimony_rerank | R Documentation | 
Promotes models with similar fitness but lower complexity to top positions.
parsimony_rerank(object, verbose=FALSE, ...)
| object | An object of class  | 
| verbose | If it is TRUE shows additional information. | 
| ... | Further arguments passed to or from other methods. | 
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.
Return a vector with the new position of the individuals.
Francisco Javier Martinez de Pison. fjmartin@unirioja.es. EDMANS Group. https://edmans.webs.com/
ga_parsimony
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),]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.