Skip to content

[6.42] [tutorials] Drop sklearn dependency from RDataLoader Higgs tutorial - #23929

Merged
guitargeek merged 1 commit into
root-project:v6-42-00-patchesfrom
root-project-bot:BP_6.42_pull_23922
Oct 31, 2026
Merged

guitargeek merged 1 commit into
root-project:v6-42-00-patchesfrom
root-project-bot:BP_6.42_pull_23922

Conversation

@root-project-bot

Copy link
Copy Markdown

Backport of #23922, requested by @guitargeek.

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.

(cherry picked from commit 6f7cb11)
@github-actions

Copy link
Copy Markdown

Test Results

    22 files      22 suites   3d 10h 3m 42s ⏱️
 3 904 tests  3 899 ✅ 0 💤 5 ❌
77 180 runs  77 175 ✅ 0 💤 5 ❌

For more details on these failures, see this check.

Results for commit 90a2aad.

@guitargeek
guitargeek merged commit e253aa8 into root-project:v6-42-00-patches Oct 31, 2026
59 of 65 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants