Remove silent parameter. (#5476)
This commit is contained in:
parent
29c6ad943a
commit
d0b86c75d9
@ -267,7 +267,7 @@ xgb.train <- function(params = list(), data, nrounds, watchlist = list(),
|
|||||||
}
|
}
|
||||||
|
|
||||||
# evaluation printing callback
|
# evaluation printing callback
|
||||||
params <- c(params, list(silent = ifelse(verbose > 1, 0, 1)))
|
params <- c(params)
|
||||||
print_every_n <- max( as.integer(print_every_n), 1L)
|
print_every_n <- max( as.integer(print_every_n), 1L)
|
||||||
if (!has.callbacks(callbacks, 'cb.print.evaluation') &&
|
if (!has.callbacks(callbacks, 'cb.print.evaluation') &&
|
||||||
verbose) {
|
verbose) {
|
||||||
|
|||||||
@ -314,7 +314,7 @@ test_that("colsample_bytree works", {
|
|||||||
watchlist <- list(train = dtrain, eval = dtest)
|
watchlist <- list(train = dtrain, eval = dtest)
|
||||||
# Use colsample_bytree = 0.01, so that roughly one out of 100 features is
|
# Use colsample_bytree = 0.01, so that roughly one out of 100 features is
|
||||||
# chosen for each tree
|
# chosen for each tree
|
||||||
param <- list(max_depth = 2, eta = 0, silent = 1, nthread = 2,
|
param <- list(max_depth = 2, eta = 0, verbosity = 0, nthread = 2,
|
||||||
colsample_bytree = 0.01, objective = "binary:logistic",
|
colsample_bytree = 0.01, objective = "binary:logistic",
|
||||||
eval_metric = "auc")
|
eval_metric = "auc")
|
||||||
set.seed(2)
|
set.seed(2)
|
||||||
|
|||||||
@ -23,10 +23,6 @@ General Parameters
|
|||||||
|
|
||||||
- Which booster to use. Can be ``gbtree``, ``gblinear`` or ``dart``; ``gbtree`` and ``dart`` use tree based models while ``gblinear`` uses linear functions.
|
- Which booster to use. Can be ``gbtree``, ``gblinear`` or ``dart``; ``gbtree`` and ``dart`` use tree based models while ``gblinear`` uses linear functions.
|
||||||
|
|
||||||
* ``silent`` [default=0] [Deprecated]
|
|
||||||
|
|
||||||
- Deprecated. Please use ``verbosity`` instead.
|
|
||||||
|
|
||||||
* ``verbosity`` [default=1]
|
* ``verbosity`` [default=1]
|
||||||
|
|
||||||
- Verbosity of printing messages. Valid values are 0 (silent), 1 (warning), 2 (info), 3
|
- Verbosity of printing messages. Valid values are 0 (silent), 1 (warning), 2 (info), 3
|
||||||
|
|||||||
@ -37,13 +37,9 @@ class BaseLogger {
|
|||||||
|
|
||||||
// Parsing both silent and debug_verbose is to provide backward compatibility.
|
// Parsing both silent and debug_verbose is to provide backward compatibility.
|
||||||
struct ConsoleLoggerParam : public XGBoostParameter<ConsoleLoggerParam> {
|
struct ConsoleLoggerParam : public XGBoostParameter<ConsoleLoggerParam> {
|
||||||
bool silent; // deprecated.
|
|
||||||
int verbosity;
|
int verbosity;
|
||||||
|
|
||||||
DMLC_DECLARE_PARAMETER(ConsoleLoggerParam) {
|
DMLC_DECLARE_PARAMETER(ConsoleLoggerParam) {
|
||||||
DMLC_DECLARE_FIELD(silent)
|
|
||||||
.set_default(false)
|
|
||||||
.describe("Do not print information during training.");
|
|
||||||
DMLC_DECLARE_FIELD(verbosity)
|
DMLC_DECLARE_FIELD(verbosity)
|
||||||
.set_range(0, 3)
|
.set_range(0, 3)
|
||||||
.set_default(1) // shows only warning
|
.set_default(1) // shows only warning
|
||||||
|
|||||||
@ -53,12 +53,6 @@ bool ConsoleLogger::ShouldLog(LogVerbosity verbosity) {
|
|||||||
|
|
||||||
void ConsoleLogger::Configure(Args const& args) {
|
void ConsoleLogger::Configure(Args const& args) {
|
||||||
param_.UpdateAllowUnknown(args);
|
param_.UpdateAllowUnknown(args);
|
||||||
// Deprecated, but when trying to display deprecation message some R
|
|
||||||
// tests trying to catch stdout will fail.
|
|
||||||
if (param_.silent) {
|
|
||||||
global_verbosity_ = LogVerbosity::kSilent;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
switch (param_.verbosity) {
|
switch (param_.verbosity) {
|
||||||
case 0:
|
case 0:
|
||||||
global_verbosity_ = LogVerbosity::kSilent;
|
global_verbosity_ = LogVerbosity::kSilent;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user