New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TST Relax test_gradient_boosting_early_stopping
#24541
TST Relax test_gradient_boosting_early_stopping
#24541
Conversation
(gbc, 1e-1, 28), | ||
(gbr, 1e-1, 13), | ||
(gbc, 1e-3, 70), | ||
(gbr, 1e-3, 28), | ||
): | ||
est.set_params(tol=tol) | ||
est.fit(X_train, y_train) | ||
assert est.n_estimators_ == early_stop_n_estimators | ||
assert ( | ||
expected_early_stop_n_estimators - delta_early_stop_n_estimators |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be enough to have an upper bound with a less-than-operator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I don't get here is why Python 3.11 would trigger this issue while other Windows builds are working.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we just follow the description of the test and simply check the following ?
gbc(tol=1e-1).fit(X, y).n_estimators_ < gbc(tol=1e-3).fit(X, y).n_estimators_
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in c47bbbd.
Co-authored-by: Jérémie du Boisberranger <jeremiedbb@users.noreply.github.com>
Thanks for this effort! Since this is blocking #24446, what's needed to get it merged? |
Just another maintainer's approval. cc @jeremiedbb: does this LGTY? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Reference Issues/PRs
Fixes a failure observed in #24446 (comment)
What does this implement/fix? Explain your changes.
Depending on platforms, the number of fitted estimators might slightly vary.
This makes
test_gradient_boosting_early_stopping
fails as it checks it against hard-coded expected values.This PR proposes relaxing
test_gradient_boosting_early_stopping
by checking for an inclusion in an interval centered in the expected number of fitted estimators rather than a strict equality.Any other comments?
Other (better) proposals are welcome!