pop <- gafs_initial(vars = 10, popSize = 10)
pop
gafs_lrSelection(population = pop, fitness = 1:10)
gafs_spCrossover(population = pop, fitness = 1:10, parents = 1:2)
## Not run: 
# ## Hypothetical examples
# lda_ga <- gafs(x = predictors,
#                y = classes,
#                gafsControl = gafsControl(functions = caretGA),
#                ## now pass arguments to `train`
#                method = "lda",
#                metric = "Accuracy"
#                trControl = trainControl(method = "cv", classProbs = TRUE))
# 
# rf_ga <- gafs(x = predictors,
#               y = classes,
#               gafsControl = gafsControl(functions = rfGA),
#               ## these are arguments to `randomForest`
#               ntree = 1000,
#               importance = TRUE)
# 	## End(Not run)
Run the code above in your browser using DataLab