Created
September 19, 2016 13:32
-
-
Save Yankim/d2c9ab1cba4709b3e3d184afda715345 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#Predicting the test data | |
xgmat.test <- xgb.DMatrix(as.matrix(higgs.test.dummy)) | |
xgboostTestPred <- predict(bst, newdata=xgmat.test) | |
predicted <- rep("s",550000) | |
predicted[xgboostTestPred>=threshold] <- "b" | |
weightRank = rank(xgboostTestPred, ties.method= "random") | |
write.csv(as.data.frame(xgboostTestPred), "Submissions/xgboost_prob.csv") | |
write.csv(as.data.frame(higgs.testId), "Submissions/EventID.csv") | |
submission = data.frame(EventId = higgs.testId, RankOrder = weightRank, Class = predicted) | |
write.csv(submission, "xgboost_submission.csv", row.names=FALSE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment