if (FALSE) { # rlang::is_installed(c("parsnip", "xgboost"))
library(xgboost)
library(parsnip)
data(agaricus.train)
bst <- xgboost(data = agaricus.train$data,
label = agaricus.train$label,
eta = 1,
nthread = 2,
nrounds = 2,
eval_metric = "logloss",
objective = "binary:logistic",
verbose = 0)
out <- butcher(bst, verbose = TRUE)
# Another xgboost model
fit <- boost_tree(mode = "classification", trees = 20) %>%
set_engine("xgboost", eval_metric = "mlogloss") %>%
fit(Species ~ ., data = iris)
out <- butcher(fit, verbose = TRUE)
}
Run the code above in your browser using DataLab