Skip to content

DOC Add information on sample_weight auto-routing to glossary and user guide - #35111

Merged
ogrisel merged 1 commit into
scikit-learn:mainfrom
StefanieSenger:doc_sample_weight
Oct 28, 2026
Merged

ogrisel merged 1 commit into
scikit-learn:mainfrom
StefanieSenger:doc_sample_weight

Conversation

@StefanieSenger

@StefanieSenger StefanieSenger commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Reference Issues/PRs

towards #34901

What does this implement/fix? Explain your changes.

This adds a few sentences on sample_weight being auto-routed everywhere in scikit-learn to the glossary and the metadata routing user guide. (Documenting it in the glossary as compared to in every docstring is a resolution from our meeting on Oct 7th.)

All of this really only takes effect after #35099, #34966 and #35095 are merged, but we are optimistic that all of these go into 1.10. 🎸

AI usage disclosure

I used AI assistance for:

  • Documentation (including examples)

@StefanieSenger StefanieSenger added the Metadata Routing all issues related to metadata routing, slep006, sample props label Oct 9, 2026
@StefanieSenger StefanieSenger moved this from Todo to PR waiting for reviews in Labs Oct 9, 2026

@ogrisel ogrisel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The diff LGTM but let's wait for the linked PR to be reviewed before merging this one to make sure that the docs always reflect the curent state of the main branch.

@StefanieSenger StefanieSenger added this to the 1.10 milestone Oct 13, 2026

@antoinebaker antoinebaker left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGMT !

Comment thread doc/metadata_routing.rst
Comment on lines +303 to +305
your `sample_weight` through a router without calling `set_fit_request` or
`set_score_request`. Use `set_{method}_request` when you need to opt out, set an alias,
or handle a consumer that does not auto-request the metadata you pass.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a bit clearer that way, but feel free to ignore if you prefer your version.

Suggested change
your `sample_weight` through a router without calling `set_fit_request` or
`set_score_request`. Use `set_{method}_request` when you need to opt out, set an alias,
or handle a consumer that does not auto-request the metadata you pass.
directly your `sample_weight` through a router, there is no need to call `set_fit_request` or
`set_score_request` explicitly. Use `set_{method}_request` only when you need to opt out, set an alias,
or handle a consumer that does not yet auto-request the metadata you pass.

@ogrisel
ogrisel merged commit 5ce1eeb into scikit-learn:main Oct 28, 2026
47 checks passed
@github-project-automation github-project-automation Bot moved this from PR waiting for reviews to Done in Labs Oct 28, 2026
@StefanieSenger
StefanieSenger deleted the doc_sample_weight branch November 2, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Metadata Routing all issues related to metadata routing, slep006, sample props

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants