-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfinalModels.R
28 lines (23 loc) · 922 Bytes
/
finalModels.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
source('autoload.R')
library(doParallel)
registerDoParallel(cores=3)
methodsMen <- c('spikeslab', 'rqlasso', 'gaussprLinear', 'lm', 'bayesglm',
'ridge', 'penalized', 'lars', 'enet', 'lasso', 'glm.nb',
'svmLinear', 'brnn')
names(methodsMen) <- methodsMen
methodsWomen <- c('lasso', 'glm.nb', 'spikeslab', 'lm', 'bayesglm', 'lars',
'rlm', 'penalized', 'ridge', 'enet', 'brnn', 'svmLinear',
'gaussprLinear')
names(methodsWomen) <- methodsWomen
fitsMen <- lapply(methodsMen, function(method) {
fms <- get('fms')
genderDb <- get('genderDb')
train(fms$`2`$forward, genderDb$`2`, method=method)
})
fitsWomen <- lapply(methodsWomen, function(method) {
fms <- get('fms')
genderDb <- get('genderDb')
train(fms$`1`$backward, genderDb$`1`, method=method)
})
allFits <- list(Male=fitsMen, Female=fitsWomen)
save(allFits, file='allFits.RData')