generate_mutation: Generate offsprings after mutation

Description Usage Arguments Author(s) Examples

Description

generate_mutation is used to generate offsprings after mutations based on particular mutation rate. And it will give the values of goodness of fit for each offspring.

Usage

1
generate_mutation(input, mutation_rate, main_dataset)

Arguments

input

A matrix contains all the populations which are required to mutate. The number in each cell should be either 0 or 1. Each row represents an individual. Each column represents the variable.

mutation_rate

The chance for each variable in each individual to change the value.

main_dataset

The dataset used to run the regression model. And its model help to get the corresponding value of goodness of fit.

regression_target

character: column of df regressed on other covariates in df

Author(s)

Xiao Li

Examples

1
2
3
4
5
6
# Generate random input and choose a specific dataset in R
regression_target <- "V1"
toy_datasets <- generate_toy_dataset(regression_target = regression_target)
main_dataset <- toy_datasets$main_dataset
population <- as.matrix(toy_datasets$population)
generate_mutation(population, 0.01, main_dataset,regression_target)

lixiao0214/GA documentation built on May 3, 2019, 7:06 p.m.