###############################################################################
# GGGGGGGGGGGGG AAA
# GGG::::::::::::G A:::A
# GG:::::::::::::::G A:::::A
# G:::::GGGGGGGG::::G A:::::::A
# G:::::G GGGGGG A:::::::::A
# G:::::G A:::::A:::::A
# G:::::G A:::::A A:::::A
# G:::::G GGGGGGGGGG A:::::A A:::::A
# G:::::G G::::::::G A:::::A A:::::A
# G:::::G GGGGG::::G A:::::AAAAAAAAA:::::A
# G:::::G G::::G A:::::::::::::::::::::A
# G:::::G G::::G A:::::AAAAAAAAAAAAA:::::A
# G:::::GGGGGGGG::::G A:::::A A:::::A
# GG:::::::::::::::G A:::::A A:::::A
# GGG::::::GGG:::G A:::::A A:::::A
# GGGGGG GGGGAAAAAAA AAAAAAA
###############################################################################
# STAT 243
# Ruitong Zhu
# Jinxin Qu
# Rowan Morse
# Jared Bennett
################################################################################
# Load Model
################################################################################
rm(list=ls());gc()
library(GA)
################################################################################
# Play Data
################################################################################
set.seed(42)
playData1 <- data.frame( matrix(data = runif(n = 900, min = 0, max = 100), nrow = 100, ncol = 9) )
colnames(playData1) <- c("Y", LETTERS[1:8])
#this causes problems. NA in model, -Inf in scores
# NA in the model comes from explanatory variables that are not linearly independent.
# do we want to handle these exceptions, or let the user figure out that their model sucks?
playData2 <- data.frame( matrix(data = runif(n = 260, min = 0, max = 100), nrow = 10, ncol = 26) )
colnames(playData2) <- c("Y", LETTERS[-25])
playData3 <- data.frame(c(1:500), c(rnorm(500)), c(201:700), c(runif(500)*10), c(rnorm(500,1,5)))
colnames(playData3) <- c("Y", "A", "B", "C", "D")
# Answer should obviously contain B
################################################################################
# Run Model
################################################################################
select(data=playData1, model=lm, methodBreed="oneScore", Pop=NULL, mutRate=0.4, scoreFunc=AIC, generations=100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.