Skip to content

Commit d0db91a

Browse files
committed
add huber to non-uniform sample weight toy test case
1 parent 5ba271b commit d0db91a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sklearn/ensemble/tests/test_gradient_boosting.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -976,10 +976,10 @@ def test_non_uniform_weights_toy_edge_case_reg():
976976
y = [0, 0, 1, 0]
977977
# ignore the first 2 training samples by setting their weight to 0
978978
sample_weight = [0, 0, 1, 1]
979-
for loss in ('ls', 'lad', 'quantile'): # not for huber
980-
gb = GradientBoostingRegressor(learning_rate=1.0, n_estimators=1, loss=loss)
979+
for loss in ('huber', 'ls', 'lad', 'quantile'):
980+
gb = GradientBoostingRegressor(learning_rate=1.0, n_estimators=2, loss=loss)
981981
gb.fit(X, y, sample_weight=sample_weight)
982-
assert_true(gb.predict([[1, 0]])[0] > 0.5, loss)
982+
assert_greater(gb.predict([[1, 0]])[0], 0.5)
983983

984984

985985
def test_non_uniform_weights_toy_min_weight_leaf():

0 commit comments

Comments
 (0)