Skip to content

Instantly share code, notes, and snippets.

@earino
Created March 3, 2014 18:38
Show Gist options
  • Save earino/9331615 to your computer and use it in GitHub Desktop.
Save earino/9331615 to your computer and use it in GitHub Desktop.
print("start.207")
for (i in 1:5) {
t <- get(paste0("d", i));
y <- factor(t[,c("start.207")], levels=c("1", "0"))
x <- t[,c("stop.165","stop.166","stop.167","stop.168","stop.169","stop.185",
"stop.186","stop.187","stop.188","stop.189","stop.205","stop.206",
"stop.207","stop.208","stop.209","stop.225","stop.226","stop.227",
"stop.228","stop.229","stop.245","stop.246","stop.247","stop.248","stop.249")]
md <- train(x, y, method="rf", ntree=ntrees, trControl=trainControl(method="cv"))
outfile <- paste0("rf.", i, ".start.207.RData")
save(md, file = outfile)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment