koaning / scikit-lego

Extra blocks for scikit-learn pipelines.
https://koaning.github.io/scikit-lego/
MIT License
1.29k stars 118 forks source link

[FEATURE] `TimeGapSplit` with stride #569

Open FBruzzesi opened 1 year ago

FBruzzesi commented 1 year ago

In the current implementation of TimeGapSplit the argument validation_duration is used as stride as well.

This leads to the impossibility of having overlapping validation periods. What about the possibility of adding a stride parameter to indicate the time shift for the training period?

The concrete use case is as follows: I would like to validate a model that retrains every week but forecast for multiple weeks ahead.

Happy to give it a try in the next following days if there is interest in adding this feature.

koaning commented 1 year ago

I'm open to it, but the maintainers of the project are spread a bit thin (I blame the baby). So it might take a while before we're able to get back to you.

FBruzzesi commented 1 year ago

Thank you Vincent for getting back to me. I can barely imagine the life with a baby 😁. As I needed that with a certain urgency I started to work towards a completely independent solution. I will calmly try to add the feature here as well!