Description Usage Arguments Value Examples
Choose parents using tournament selection. Each time, randomly pick k models from the previous generation and the best-performed model will be selected as the parent. Repeat this process until all slots for parents are filled.
1 | tournament(models, k)
|
models |
dataframe with models (specified by the index of selected variables) and their respective fitness value. Object returned by ranked_models(). |
k |
size of each round of selection. Must be an integer smaller than generation size. |
The selected parents(list of ceiling(nrow(models)/2) lists, each list contains two parents)
1 2 3 4 5 | x <- mtcars[-1]
y <- unlist(mtcars[1])
initial_index <- initialize_parents(10,20)$index
rankedmodels <- ranked_models(initial_index,x,y)
tournament(rankedmodels,k = 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.