Skip to content

DOC Add example for implementing a custom GroupTimeSeriesSplit - #34852

Open
ArturoAmorQ wants to merge 2 commits into
scikit-learn:mainfrom
ArturoAmorQ:custom_splitter_example
Open

ArturoAmorQ wants to merge 2 commits into
scikit-learn:mainfrom
ArturoAmorQ:custom_splitter_example

Conversation

@ArturoAmorQ

Copy link
Copy Markdown
Member

Reference Issues/PRs

Fixes #28828. Addresses #14257. Takes over #34450. See also #16236 and #19072.

What does this implement/fix? Explain your changes.

This PR adds an example to show how to write a custom cv splitter to be scikit-learn compatible. As a motivating use case, the example implements a group-aware time series split.

Group structure can be handled in several ways, depending on the use case. No single built-in class covers every combination, which is why it may be better to rely on a custom cross-validation splitter.

Introduce yourself

AI usage disclosure

I used AI assistance for:

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Documentation (including examples)

Any other comments?

cc @glemaitre as I'm using his dataset ;)

This branch has not been deployed

No deployments
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.

Provide examples on how to customize the scikit-learn classes

1 participant