| cla_xgboost | R Documentation |
Gradient boosting classifier using xgboost.
cla_xgboost(attribute, params = list(), nrounds = 20)
attribute |
target attribute name |
params |
list of xgboost parameters |
nrounds |
number of boosting rounds |
returns a cla_xgboost object
if (requireNamespace("xgboost", quietly = TRUE)) {
data(iris)
# This setup keeps the example fast for checks and documentation builds.
# A more typical starting point is:
# model <- cla_xgboost("Species")
model <- cla_xgboost(
"Species",
params = list(max_depth = 1, nthread = 1),
nrounds = 1
)
model <- fit(model, iris)
pred <- predict(model, iris)
eval <- evaluate(model, adjust_class_label(iris$Species), pred)
eval$metrics
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.