8000 troubleshooting for CI tests for #19304 · scikit-learn/scikit-learn@fd242b7 · GitHub
[go: up one dir, main page]

Skip to content

Commit fd242b7

Browse files
committed
troubleshooting for CI tests for #19304
1 parent 168e8d3 commit fd242b7

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

doc/whats_new/v1.0.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ Changelog
163163
:pr:`19564` by `Thomas Fan`_.
164164

165165
- |Enhancement| Documented and tested support of the Poisson criterion for
166-
:class:`ensemble.RandomForestRegressor`. :pr:`19836` by
167-
:user:`Brian Sun <bsun94>`.
166+
:class:`ensemble.RandomForestRegressor`. :pr:`19836` by
167+
:user:`Brian Sun <bsun94>`.
168168

169169
:mod:`sklearn.feature_extraction`
170170
.................................

sklearn/ensemble/tests/test_forest.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,24 +1358,24 @@ def test_min_impurity_decrease():
13581358
# will suffice for the actual working of this param
13591359
assert tree.min_impurity_decrease == 0.1
13601360

1361+
13611362
def test_poisson_y_positive_check():
13621363
est = RandomForestRegressor(criterion="poisson")
13631364
X = np.zeros((3, 3))
13641365

13651366
y = [-1, 1, 3]
1366-
with pytest.raises(
1367-
ValueError,
1368-
match="Some.*y are negative.*Poisson.*\."
1369-
):
1367+
err_msg = (r"Some value\(s\) of y are negative which is "
1368+
r"not allowed for Poisson regression.")
1369+
with pytest.raises(ValueError, match=err_msg):
13701370
est.fit(X, y)
13711371

13721372
y = [0, 0, 0]
1373-
with pytest.raises(
1374-
ValueError,
1375-
match="Sum of y is not positive.*Poisson regression\."
1376-
):
1373+
err_msg = (r"Sum of y is not strictly positive which "
1374+
r"is necessary for Poisson regression.")
1375+
with pytest.raises(ValueError, match=err_msg):
13771376
est.fit(X, y)
13781377

1378+
13791379
# mypy error: Variable "DEFAULT_JOBLIB_BACKEND" is not valid type
13801380
class MyBackend(DEFAULT_JOBLIB_BACKEND): # type: ignore
13811381
def __init__(self, *args, **kwargs):

0 commit comments

Comments
 (0)
0