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

@@ -10,7 +10,8 @@ train_data = xgb.DMatrix(np.array([[1]]), label=np.array([1]))
class TestTreeRegularization(unittest.TestCase):
def test_alpha(self):
params = {
'tree_method': 'exact', 'silent': 1, 'objective': 'reg:linear',
'tree_method': 'exact', 'verbosity': 0,
'objective': 'reg:squarederror',
'eta': 1,
'lambda': 0,
'alpha': 0.1
@@ -27,7 +28,8 @@ class TestTreeRegularization(unittest.TestCase):
def test_lambda(self):
params = {
'tree_method': 'exact', 'silent': 1, 'objective': 'reg:linear',
'tree_method': 'exact', 'verbosity': 0,
'objective': 'reg:squarederror',
'eta': 1,
'lambda': 1,
'alpha': 0
@@ -44,7 +46,8 @@ class TestTreeRegularization(unittest.TestCase):
def test_alpha_and_lambda(self):
params = {
'tree_method': 'exact', 'silent': 1, 'objective': 'reg:linear',
'tree_method': 'exact', 'verbosity': 1,
'objective': 'reg:squarederror',
'eta': 1,
'lambda': 1,
'alpha': 0.1