Repository navigation
[tutorials] Drop sklearn dependency from RDataLoader Higgs tutorial - #23922
Merged
guitargeek merged 1 commit intoOct 30, 2026
Merged
guitargeek merged 1 commit into
guitargeek merged 1 commit into
Conversation
guitargeek
requested review from
bellenot,
dpiparo and
silverweed
as code owners
October 30, 2026 17:39
Right now, the `ml_dataloader_Higgs_Classification.py` tutorial test is failing when sklearn is not installed. The tutorial only used scikit-learn for `roc_curve`, which is a few lines of NumPy. Replace it with a small local helper that is equivalent to `sklearn.metrics.roc_curve(..., drop_intermediate=False)`, so the tutorial can run without scikit-learn installed. Also plot the full ROC curve: the previous code dropped the last point, i.e. the (1, 1) end of the curve. Register the tutorial in the `requires_numpy` fixture list, since it now imports NumPy directly, and in `requires_matplotlib`, which it had always needed but never declared. The alternative to this commit would have been to register the `sklearn` dependency in the `tutorials/CMakeLists.txt`, but reducing the test dependency on external Python packages is also a goal in itself.
guitargeek
force-pushed
the
tutorials-higgs-classification-no-sklearn
branch
from
October 30, 2026 17:49
f5b8b9d to
9090254
Compare
dpiparo
approved these changes
Oct 30, 2026
Contributor
Author
|
/backport to 6.40 |
|
Preparing to backport PR #23922 to branch 6.40 requested by guitargeek |
|
Something went wrong with the creation of the PR to backport to 6.40: @guitargeek please see the logs |
Contributor
Author
|
/backport to 6.42 |
|
Preparing to backport PR #23922 to branch 6.42 requested by guitargeek |
|
This PR has been backported to branch 6.42: #23929 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Right now, the
ml_dataloader_Higgs_Classification.pytutorial test is failing when sklearn is not installed.The tutorial only used scikit-learn for
roc_curve, which is a few lines of NumPy. Replace it with a small local helper that is equivalent tosklearn.metrics.roc_curve(..., drop_intermediate=False), so the tutorial can run without scikit-learn installed.Also plot the full ROC curve: the previous code dropped the last point, i.e. the (1, 1) end of the curve.
Register the tutorial in the
requires_numpyfixture list, since it now imports NumPy directly, and inrequires_matplotlib, which it had always needed but never declared.The alternative to this commit would have been to register the
sklearndependency in thetutorials/CMakeLists.txt, but reducing the test dependency on external Python packages is also a goal in itself.