[R] put 'verbose' in correct argument (#9942)
This commit is contained in:
parent
73713de601
commit
32cbab1cc0
@ -251,9 +251,9 @@
|
|||||||
#' watchlist <- list(train = dtrain, eval = dtest)
|
#' watchlist <- list(train = dtrain, eval = dtest)
|
||||||
#'
|
#'
|
||||||
#' ## A simple xgb.train example:
|
#' ## A simple xgb.train example:
|
||||||
#' param <- list(max_depth = 2, eta = 1, verbose = 0, nthread = nthread,
|
#' param <- list(max_depth = 2, eta = 1, nthread = nthread,
|
||||||
#' objective = "binary:logistic", eval_metric = "auc")
|
#' objective = "binary:logistic", eval_metric = "auc")
|
||||||
#' bst <- xgb.train(param, dtrain, nrounds = 2, watchlist)
|
#' bst <- xgb.train(param, dtrain, nrounds = 2, watchlist, verbose = 0)
|
||||||
#'
|
#'
|
||||||
#' ## An xgb.train example where custom objective and evaluation metric are
|
#' ## An xgb.train example where custom objective and evaluation metric are
|
||||||
#' ## used:
|
#' ## used:
|
||||||
@ -272,13 +272,13 @@
|
|||||||
#'
|
#'
|
||||||
#' # These functions could be used by passing them either:
|
#' # These functions could be used by passing them either:
|
||||||
#' # as 'objective' and 'eval_metric' parameters in the params list:
|
#' # as 'objective' and 'eval_metric' parameters in the params list:
|
||||||
#' param <- list(max_depth = 2, eta = 1, verbose = 0, nthread = nthread,
|
#' param <- list(max_depth = 2, eta = 1, nthread = nthread,
|
||||||
#' objective = logregobj, eval_metric = evalerror)
|
#' objective = logregobj, eval_metric = evalerror)
|
||||||
#' bst <- xgb.train(param, dtrain, nrounds = 2, watchlist)
|
#' bst <- xgb.train(param, dtrain, nrounds = 2, watchlist, verbose = 0)
|
||||||
#'
|
#'
|
||||||
#' # or through the ... arguments:
|
#' # or through the ... arguments:
|
||||||
#' param <- list(max_depth = 2, eta = 1, verbose = 0, nthread = nthread)
|
#' param <- list(max_depth = 2, eta = 1, nthread = nthread)
|
||||||
#' bst <- xgb.train(param, dtrain, nrounds = 2, watchlist,
|
#' bst <- xgb.train(param, dtrain, nrounds = 2, watchlist, verbose = 0,
|
||||||
#' objective = logregobj, eval_metric = evalerror)
|
#' objective = logregobj, eval_metric = evalerror)
|
||||||
#'
|
#'
|
||||||
#' # or as dedicated 'obj' and 'feval' parameters of xgb.train:
|
#' # or as dedicated 'obj' and 'feval' parameters of xgb.train:
|
||||||
@ -287,10 +287,10 @@
|
|||||||
#'
|
#'
|
||||||
#'
|
#'
|
||||||
#' ## An xgb.train example of using variable learning rates at each iteration:
|
#' ## An xgb.train example of using variable learning rates at each iteration:
|
||||||
#' param <- list(max_depth = 2, eta = 1, verbose = 0, nthread = nthread,
|
#' param <- list(max_depth = 2, eta = 1, nthread = nthread,
|
||||||
#' objective = "binary:logistic", eval_metric = "auc")
|
#' objective = "binary:logistic", eval_metric = "auc")
|
||||||
#' my_etas <- list(eta = c(0.5, 0.1))
|
#' my_etas <- list(eta = c(0.5, 0.1))
|
||||||
#' bst <- xgb.train(param, dtrain, nrounds = 2, watchlist,
|
#' bst <- xgb.train(param, dtrain, nrounds = 2, watchlist, verbose = 0,
|
||||||
#' callbacks = list(cb.reset.parameters(my_etas)))
|
#' callbacks = list(cb.reset.parameters(my_etas)))
|
||||||
#'
|
#'
|
||||||
#' ## Early stopping:
|
#' ## Early stopping:
|
||||||
|
|||||||
@ -303,9 +303,9 @@ dtest <- with(
|
|||||||
watchlist <- list(train = dtrain, eval = dtest)
|
watchlist <- list(train = dtrain, eval = dtest)
|
||||||
|
|
||||||
## A simple xgb.train example:
|
## A simple xgb.train example:
|
||||||
param <- list(max_depth = 2, eta = 1, verbose = 0, nthread = nthread,
|
param <- list(max_depth = 2, eta = 1, nthread = nthread,
|
||||||
objective = "binary:logistic", eval_metric = "auc")
|
objective = "binary:logistic", eval_metric = "auc")
|
||||||
bst <- xgb.train(param, dtrain, nrounds = 2, watchlist)
|
bst <- xgb.train(param, dtrain, nrounds = 2, watchlist, verbose = 0)
|
||||||
|
|
||||||
## An xgb.train example where custom objective and evaluation metric are
|
## An xgb.train example where custom objective and evaluation metric are
|
||||||
## used:
|
## used:
|
||||||
@ -324,13 +324,13 @@ evalerror <- function(preds, dtrain) {
|
|||||||
|
|
||||||
# These functions could be used by passing them either:
|
# These functions could be used by passing them either:
|
||||||
# as 'objective' and 'eval_metric' parameters in the params list:
|
# as 'objective' and 'eval_metric' parameters in the params list:
|
||||||
param <- list(max_depth = 2, eta = 1, verbose = 0, nthread = nthread,
|
param <- list(max_depth = 2, eta = 1, nthread = nthread,
|
||||||
objective = logregobj, eval_metric = evalerror)
|
objective = logregobj, eval_metric = evalerror)
|
||||||
bst <- xgb.train(param, dtrain, nrounds = 2, watchlist)
|
bst <- xgb.train(param, dtrain, nrounds = 2, watchlist, verbose = 0)
|
||||||
|
|
||||||
# or through the ... arguments:
|
# or through the ... arguments:
|
||||||
param <- list(max_depth = 2, eta = 1, verbose = 0, nthread = nthread)
|
param <- list(max_depth = 2, eta = 1, nthread = nthread)
|
||||||
bst <- xgb.train(param, dtrain, nrounds = 2, watchlist,
|
bst <- xgb.train(param, dtrain, nrounds = 2, watchlist, verbose = 0,
|
||||||
objective = logregobj, eval_metric = evalerror)
|
objective = logregobj, eval_metric = evalerror)
|
||||||
|
|
||||||
# or as dedicated 'obj' and 'feval' parameters of xgb.train:
|
# or as dedicated 'obj' and 'feval' parameters of xgb.train:
|
||||||
@ -339,10 +339,10 @@ bst <- xgb.train(param, dtrain, nrounds = 2, watchlist,
|
|||||||
|
|
||||||
|
|
||||||
## An xgb.train example of using variable learning rates at each iteration:
|
## An xgb.train example of using variable learning rates at each iteration:
|
||||||
param <- list(max_depth = 2, eta = 1, verbose = 0, nthread = nthread,
|
param <- list(max_depth = 2, eta = 1, nthread = nthread,
|
||||||
objective = "binary:logistic", eval_metric = "auc")
|
objective = "binary:logistic", eval_metric = "auc")
|
||||||
my_etas <- list(eta = c(0.5, 0.1))
|
my_etas <- list(eta = c(0.5, 0.1))
|
||||||
bst <- xgb.train(param, dtrain, nrounds = 2, watchlist,
|
bst <- xgb.train(param, dtrain, nrounds = 2, watchlist, verbose = 0,
|
||||||
callbacks = list(cb.reset.parameters(my_etas)))
|
callbacks = list(cb.reset.parameters(my_etas)))
|
||||||
|
|
||||||
## Early stopping:
|
## Early stopping:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user