Remove warning in 1.4. (#7815)

This commit is contained in:
Jiaming Yuan 2022-04-20 01:19:09 +08:00 committed by GitHub
parent d0de954af2
commit 5815df4c46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1200,16 +1200,6 @@ class LearnerImpl : public LearnerIO {
os.precision(std::numeric_limits<double>::max_digits10);
os << '[' << iter << ']' << std::setiosflags(std::ios::fixed);
if (metrics_.size() == 0 && tparam_.disable_default_eval_metric <= 0) {
auto warn_default_eval_metric = [](const std::string& objective, const std::string& before,
const std::string& after, const std::string& version) {
LOG(WARNING) << "Starting in XGBoost " << version << ", the default evaluation metric "
<< "used with the objective '" << objective << "' was changed from '"
<< before << "' to '" << after << "'. Explicitly set eval_metric if you'd "
<< "like to restore the old behavior.";
};
if (tparam_.objective == "binary:logitraw") {
warn_default_eval_metric(tparam_.objective, "auc", "logloss", "1.4.0");
}
metrics_.emplace_back(Metric::Create(obj_->DefaultEvalMetric(), &generic_parameters_));
metrics_.back()->Configure({cfg_.begin(), cfg_.end()});
}