Skip to content

[Callbacks] API explicit X, y instead of data in on_fit_task_*#33566

Merged
ogrisel merged 1 commit intoscikit-learn:callbacksfrom
jeremiedbb:data-X-y
Mar 17, 2026
Merged

[Callbacks] API explicit X, y instead of data in on_fit_task_*#33566
ogrisel merged 1 commit intoscikit-learn:callbacksfrom
jeremiedbb:data-X-y

Conversation

@jeremiedbb
Copy link
Copy Markdown
Member

I initially thought that X_val and y_val were not in the scope of the metadata routing so I had put (X, y, X_val, y_val) in data.
But looking back at the transform_input of the pipeline (https://scikit-learn.org/dev/modules/generated/sklearn.pipeline.Pipeline.html#:~:text=transform_input,-list%20of%20str%2C%20default%3DNone) and at this https://scikit-learn.org/stable/auto_examples/release_highlights/plot_release_highlights_1_6_0.html#transforming-data-other-than-x-in-a-pipeline, we realized that X_val and y_val are (and must be) routed using metadata routing.

So as discussed in the last meeting, we thought it made more sense to come back to an explicit X, y in the signature of the callback hooks.

ping @ogrisel @FrancoisPgm @StefanieSenger @lesteve

@jeremiedbb jeremiedbb added No Changelog Needed Quick Review For PRs that are quick to review Callbacks labels Mar 17, 2026
@ogrisel ogrisel merged commit a9973bf into scikit-learn:callbacks Mar 17, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Callbacks No Changelog Needed Quick Review For PRs that are quick to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants