Created
September 5, 2016 22:34
-
-
Save ckholmes5/923e6f4213685ca067e9d2a66161f5d1 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
bst0 = xgb.train(data = dtrain_0, max.depth = 9, eta = .01,sub_sample = .9, nround = 3000, objective = "binary:logistic") | |
bst1 = xgb.train(data = dtrain_1, max.depth = 9, eta = .01,sub_sample = .9, nround = 3000, objective = "binary:logistic") | |
bst2 = xgb.train(data = dtrain_2, max.depth = 9, eta = .01,sub_sample = .9, nround = 3000, objective = "binary:logistic") | |
bst3 = xgb.train(data = dtrain_3, max.depth = 9, eta = .01,sub_sample = .9, nround = 3000, objective = "binary:logistic") | |
#Predicting | |
pred_gb_pred_0 = predict(bst0, newdata=test_m_0) | |
pred_gb_pred_1 = predict(bst1, newdata=test_m_1) | |
pred_gb_pred_2 = predict(bst2, newdata=test_m_2) | |
pred_gb_pred_3 = predict(bst3, newdata=test_m_3) | |
gb_prediction_0 <- ifelse(pred_gb_pred_0 > 0.5, 's', 'b') | |
gb_prediction_1 <- ifelse(pred_gb_pred_1 > 0.5, 's', 'b') | |
gb_prediction_2 <- ifelse(pred_gb_pred_2 > 0.5, 's', 'b') | |
gb_prediction_3 <- ifelse(pred_gb_pred_3 > 0.5, 's', 'b') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment