Chapter 21 Predictions using the XGB Model

predictions = predict(AuthorXGB,labeledTermsTest,type = 'prob')

# Save the solution to a dataframe
solution <- data.frame('id' = test$id, predictions)

head(solution)
##        id       EAP       HPL       MWS
## 1 id02310 0.2020102 0.2493993 0.5485905
## 2 id24541 0.4381515 0.3032377 0.2586108
## 3 id00134 0.3396536 0.4587254 0.2016211
## 4 id27757 0.4239962 0.3229545 0.2530494
## 5 id04081 0.5903386 0.1773055 0.2323559
## 6 id27337 0.3906093 0.3939233 0.2154674
# Write it to file
write.csv(solution, 'XGBEDASpooky26Oct2017.csv', row.names = F)