Created
March 30, 2016 15:53
-
-
Save sriyoda/025de89e8d8787f093af91f3d5e68c25 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gbmFit.ada = gbm(formula = ylearn ~., | |
distribution = 'adaboost', | |
data = xlearn, | |
n.trees = 10000, #the number of trees in the model | |
interaction.depth = 5, #each tree will evaluate five decisions | |
n.minobsinnode = 2, #the number of obs present to yield a terminal node, higher means more conservative fit | |
shrinkage = .01, #the learning rate, dictates how fast the algorithm moves across the loss gradient | |
bag.fraction = 0.5, #subsampling fraction, 0.5 is best | |
train.fraction = 0.8, #fraction of data for training | |
cv.folds = 5) #running five-fold cross-validation | |
test_data$preds_ada = predict(gbmFit.ada, test_data, n.trees = best.cv.ada, type = 'response') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment