Description Usage Arguments Value Examples
xgb.auc is an automatic parameter adjustment function which is applied to the Classification task by xgboost.
1 2 3 4 5 6 7 8 9 |
data |
training dataset. xgb.auc accepts only an |
n |
the number of cycles. |
cvround |
max number of boosting iterations. |
cvfold |
the original dataset is randomly partitioned into |
early_stopping_rounds |
If NULL, the early stopping function is not triggered. If set to an integer k, training with a validation set will stop if the performance doesn't improve for k rounds. |
seed.number |
random number seed. |
nthread |
number of thread used in training. |
a list
contains the best_param,the best_auc and best_auc_index.
1 2 3 4 5 6 7 8 9 10 11 | library(xgboost)
data(redwine,package="XGBparsel")
redwine$grade[redwine$quality <= 5] <- "0"
redwine$grade[redwine$quality >= 6] <- "1"
myvars <- names(redwine) %in% "quality"
redwine <- redwine[!myvars]
redwine_s <- Matrix::sparse.model.matrix( grade~.-1 ,data = redwine)
train <- xgb.DMatrix( data = redwine_s , label = redwine$grade )
fit <-xgb.auc(train,10,cvround=100,cvfold=5,
early_stopping_rounds =10,
seed.number = 12345,nthread = 8)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.