Deprecate reg:linear' in favor of reg:squarederror'. (#4267)

* Deprecate `reg:linear' in favor of `reg:squarederror'.
* Replace the use of `reg:linear'.
* Replace the use of `silent`.
This commit is contained in:
Jiaming Yuan
2019-03-17 17:55:04 +08:00
committed by GitHub
parent cf8d5b9b76
commit 29a1356669
34 changed files with 210 additions and 193 deletions

View File

@@ -1,4 +1,5 @@
// Copyright by Contributors
#include <gtest/gtest.h>
#include <xgboost/objective.h>
#include "../helpers.h"
@@ -6,7 +7,7 @@
TEST(Objective, UnknownFunction) {
xgboost::ObjFunction* obj = nullptr;
EXPECT_ANY_THROW(obj = xgboost::ObjFunction::Create("unknown_name"));
EXPECT_NO_THROW(obj = xgboost::ObjFunction::Create("reg:linear"));
EXPECT_NO_THROW(obj = xgboost::ObjFunction::Create("reg:squarederror"));
if (obj) {
delete obj;
}

View File

@@ -1,12 +1,13 @@
/*!
* Copyright 2017-2018 XGBoost contributors
* Copyright 2017-2019 XGBoost contributors
*/
#include <gtest/gtest.h>
#include <xgboost/objective.h>
#include "../helpers.h"
TEST(Objective, DeclareUnifiedTest(LinearRegressionGPair)) {
xgboost::ObjFunction * obj = xgboost::ObjFunction::Create("reg:linear");
xgboost::ObjFunction * obj = xgboost::ObjFunction::Create("reg:squarederror");
std::vector<std::pair<std::string, std::string> > args;
obj->Configure(args);
CheckObjFunction(obj,