Skip to content

DOC Add auto-requesting metadata section to user guide - #35019

Merged
StefanieSenger merged 4 commits into
scikit-learn:mainfrom
StefanieSenger:user_doc_auto-requests
Oct 5, 2026
Merged

StefanieSenger merged 4 commits into
scikit-learn:mainfrom
StefanieSenger:user_doc_auto-requests

Conversation

@StefanieSenger

Copy link
Copy Markdown
Member

Reference Issues/PRs

towards #34901

What does this implement/fix? Explain your changes.

This is a follow up to #31413 and adds documentation on how to use auto-requests into the user docs.

AI usage disclosure

I used AI assistance for:

  • Documentation (including examples)
  • Research and understanding

@github-project-automation github-project-automation Bot moved this to Todo in Labs Sep 22, 2026
@StefanieSenger StefanieSenger moved this from Todo to PR waiting for reviews in Labs Sep 22, 2026

@mhmd-81 mhmd-81 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could we keep the terminology consistent here and use “metadata routing” instead of “metadata” where appropriate? For example, “whether to use the metadata within the different consumers” could perhaps be clarified as “whether to route the metadata to the different consumers.”

@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.

Besides the following detail, LGTM.

Note that this doc will have to be reshuffled/updated/simplified if/when we decide to set enable_metadata_auto_requests=False by default in the future.

Comment thread doc/metadata_routing.rst Resolved
@StefanieSenger

Copy link
Copy Markdown
Member Author

Could we keep the terminology consistent here and use “metadata routing” instead of “metadata” where appropriate? For example, “whether to use the metadata within the different consumers” could perhaps be clarified as “whether to route the metadata to the different consumers.”

Thanks @mhmd-81, but there is a difference between using metadata in a method and using metadata routing as a (more wholistic) tool, and I had meant these two different things there.

@StefanieSenger StefanieSenger left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks a lot for the reviews! :)

Comment thread doc/metadata_routing.rst Resolved
@StefanieSenger

Copy link
Copy Markdown
Member Author

@adrinjalali, do you mind having a look?

Comment thread doc/metadata_routing.rst Outdated
Auto-requests are declared for specific metadata such as ``sample_weight``, ``X_val``,
``y_val`` and ``sample_weight_val``. Once a metadata is supported, methods that take
that argument are expected to auto-request it. (``groups`` in ``Group*Fold`` is not an
auto-request and is requested by default whether auto-requests are switched on or off.)

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.

and that's because it's not that it "can" consume it, rather, it "requires" it to work.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Is there anything you'd like me to change here, @adrinjalali?

Comment thread doc/metadata_routing.rst Resolved

@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.

Thanks @StefanieSenger, LGTM !

I guess the Metadata Routing User guide will be simplified greatly once the auto request policy is enabled by default, something along the lines of

"Everything should work out of the box for common metadata like sample_weight, groups etc. If you're a developer and want to support some metadata, see the auto request guide. If you're a user and want to opt out or alias some metadata, here's how to do it with explicit set_{method}_request examples."

@StefanieSenger

Copy link
Copy Markdown
Member Author

I guess the Metadata Routing User guide will be simplified greatly once the auto request policy is enabled by default,

Yes, that will be a very satisfying PR.

Comment thread doc/metadata_routing.rst Resolved
@StefanieSenger

Copy link
Copy Markdown
Member Author

I think this one is good to merge.
We can always improve the docs with a follow-up PR.

@StefanieSenger
StefanieSenger merged commit b82293a into scikit-learn:main Oct 5, 2026
37 checks passed
@StefanieSenger
StefanieSenger deleted the user_doc_auto-requests branch October 5, 2026 08:31
@StefanieSenger StefanieSenger added the Metadata Routing all issues related to metadata routing, slep006, sample props label Oct 7, 2026
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.

5 participants