result <- gbt(
titanic, "survived", c("pclass", "sex"),
early_stopping_rounds = 2, nthread = 1
)
predict(result, pred_cmd = "pclass = levels(pclass)")
result <- gbt(diamonds, "price", "carat:color", type = "regression", nthread = 1)
predict(result, pred_cmd = "carat = 1:3")
predict(result, pred_data = diamonds) %>% head()
Run the code above in your browser using DataLab