Init estimation for regression. (#8272)
This commit is contained in:
@@ -9,11 +9,13 @@ train_data = xgb.DMatrix(np.array([[1]]), label=np.array([1]))
|
||||
class TestTreeRegularization:
|
||||
def test_alpha(self):
|
||||
params = {
|
||||
'tree_method': 'exact', 'verbosity': 0,
|
||||
'objective': 'reg:squarederror',
|
||||
'eta': 1,
|
||||
'lambda': 0,
|
||||
'alpha': 0.1
|
||||
"tree_method": "exact",
|
||||
"verbosity": 0,
|
||||
"objective": "reg:squarederror",
|
||||
"eta": 1,
|
||||
"lambda": 0,
|
||||
"alpha": 0.1,
|
||||
"base_score": 0.5,
|
||||
}
|
||||
|
||||
model = xgb.train(params, train_data, 1)
|
||||
@@ -27,11 +29,13 @@ class TestTreeRegularization:
|
||||
|
||||
def test_lambda(self):
|
||||
params = {
|
||||
'tree_method': 'exact', 'verbosity': 0,
|
||||
'objective': 'reg:squarederror',
|
||||
'eta': 1,
|
||||
'lambda': 1,
|
||||
'alpha': 0
|
||||
"tree_method": "exact",
|
||||
"verbosity": 0,
|
||||
"objective": "reg:squarederror",
|
||||
"eta": 1,
|
||||
"lambda": 1,
|
||||
"alpha": 0,
|
||||
"base_score": 0.5,
|
||||
}
|
||||
|
||||
model = xgb.train(params, train_data, 1)
|
||||
@@ -45,11 +49,13 @@ class TestTreeRegularization:
|
||||
|
||||
def test_alpha_and_lambda(self):
|
||||
params = {
|
||||
'tree_method': 'exact', 'verbosity': 1,
|
||||
'objective': 'reg:squarederror',
|
||||
'eta': 1,
|
||||
'lambda': 1,
|
||||
'alpha': 0.1
|
||||
"tree_method": "exact",
|
||||
"verbosity": 1,
|
||||
"objective": "reg:squarederror",
|
||||
"eta": 1,
|
||||
"lambda": 1,
|
||||
"alpha": 0.1,
|
||||
"base_score": 0.5,
|
||||
}
|
||||
|
||||
model = xgb.train(params, train_data, 1)
|
||||
|
||||
Reference in New Issue
Block a user