xgb.rmse: xgb.rmse

Description Usage Arguments Value Examples

View source: R/xgb_rmse.R

Description

xgb.rmse is an automatic parameter adjustment function which is applied to the regression task by xgboost.

Usage

1
2
3
4
5
6
7
8
9
xgb.rmse(
  data,
  n,
  cvround = cvround,
  cvfold = cvfold,
  early_stopping_rounds = early_stopping_rounds,
  seed.number = seed.number,
  nthread = nthread
)

Arguments

data

training dataset. xgb.rmse accepts only an xgb.DMatrix as the input.

n

the number of cycles.

cvround

max number of boosting iterations.

cvfold

the original dataset is randomly partitioned into nfold equal size subsamples.

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.

Value

a list contains the best_param,the best_rmse and best_rmse_index.

Examples

1
2
3
4
5
6
7
8
library(xgboost)
data(agaricus.train, package='xgboost')
data(agaricus.test, package='xgboost')
dtrain <- xgb.DMatrix(agaricus.train$data, label = agaricus.train$label)
dtest <- xgb.DMatrix(agaricus.test$data, label = agaricus.test$label)
fit <-xgb.rmse(dtrain,10,cvround=100,cvfold=5,
                  early_stopping_rounds =10,
                  seed.number = 12345,nthread = 8)

zhangyuqiangarchie/XGBparsel2 documentation built on Dec. 23, 2021, 9:18 p.m.