data(agaricus.train, package = "xgboost")
## Keep the number of threads to 2 for examples
nthread <- 2
data.table::setDTthreads(nthread)
## Change max_depth to a higher number to get a more significant result
model <- xgboost(
agaricus.train$data, factor(agaricus.train$label),
nrounds = 50,
max_depth = 6,
nthreads = nthread,
subsample = 0.5,
min_child_weight = 2
)
xgb.plot.deepness(model)
xgb.ggplot.deepness(model)
xgb.plot.deepness(
model, which = "max.depth", pch = 16, col = rgb(0, 0, 1, 0.3), cex = 2
)
xgb.plot.deepness(
model, which = "med.weight", pch = 16, col = rgb(0, 0, 1, 0.3), cex = 2
)
Run the code above in your browser using DataLab