Skip to content

Instantly share code, notes, and snippets.

@tengpeng
Created February 8, 2016 05:20
Show Gist options
  • Save tengpeng/fe976963d044623aae23 to your computer and use it in GitHub Desktop.
Save tengpeng/fe976963d044623aae23 to your computer and use it in GitHub Desktop.
bagging r
# Do bagging
tmpP = rep(0,nrow(test))
for (j in 1:30) {
set.seed(j+200)
print(j)
bst = xgb.train(param=param, data=xgtrain, nrounds=1200)
tmpP = tmpP + predict(bst,xgtest)
}
tmpP = tmpP/j
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment