Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] Frequency based cross-validation and gap parameter #89

Open
baggiponte opened this issue Oct 16, 2023 · 2 comments
Open

[FEAT] Frequency based cross-validation and gap parameter #89

baggiponte opened this issue Oct 16, 2023 · 2 comments
Labels
enhancement New feature or request forecasting Forecasters and adapters help wanted Extra attention is needed
Milestone

Comments

@baggiponte
Copy link
Collaborator

In the discord server, a while ago we mentioned the possibility of generating CV splits based on time intervals (e.g. the first day of the month or week). This might be useful for financial settings especially (e.g. retraining the model on mondays).

Plus, it might be useful to provide a gap parameter to allow for gaps between the train and test set (supported e.g. by skforecast):

image

plot source

@baggiponte baggiponte added the enhancement New feature or request label Oct 16, 2023
@baggiponte baggiponte added the help wanted Extra attention is needed label Apr 21, 2024
@elyase
Copy link

elyase commented Apr 27, 2024

some additional references:

sktime: provides several splitting strategies: temporal_train_test_split (only sample space split), SlidingWindowSplitter, SlidingWindowSplitter, ExpandingWindowSplitter, CutoffSplitter (window can be a datetime)

darts: only provides train_test_split but supports specifying the splits both in time and in sample space via an axis parameter.

edit: clarification from @FBruzzesi

The .backtest(...) method in darts offers flexible training options, including a custom callable for the retrain parameter to control model retraining based on timestamps. This allows for custom time windows, though customizing test sizes may be less straightforward.

@FBruzzesi
Copy link
Contributor

Hey @elyase, thanks for adding the suggestion.

As mentioned on discord, I was dealing with this kind of issue myself and came up with a rough implementation in timebasedcv (some shameless promotion).

I wanted something that is scikit-learn compatible, hence supports (at least) numpy, pandas and polars.
I am not claiming it is the perfect solution by any mean, but I believe it brings a lot of the features that you are looking for.

Regarding integration with functime, I should double check how to make interaction with the id/entity column.

@baggiponte baggiponte added the forecasting Forecasters and adapters label Jun 9, 2024
@baggiponte baggiponte added this to the 1.0.0 milestone Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request forecasting Forecasters and adapters help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants