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

Walk forward cross-validation in tsai #582

Closed
alitirmizi23 opened this issue Sep 23, 2022 · 4 comments
Closed

Walk forward cross-validation in tsai #582

alitirmizi23 opened this issue Sep 23, 2022 · 4 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@alitirmizi23
Copy link

I was wondering if there are plans to implement walk forward CV in TSAI. #

@vrodriguezf
Copy link
Contributor

By default, the function get_splits with n_splits > 0 creates disjunct splits, so ou can use them as folds in a CV process.

@oguiza oguiza added documentation Improvements or additions to documentation enhancement New feature or request labels Oct 21, 2022
@oguiza oguiza closed this as completed in ea63ecc Oct 21, 2022
@oguiza
Copy link
Contributor

oguiza commented Oct 21, 2022

Hi @alitirmizi23, cc: @vrodriguezf ,
Thanks for creating this issue.
This is something I've had in mind for quite some time. I've found some time this morning to add this new functionality. You can use it by doing this:

from tsai.data.validation import get_walk_forward_splits
splits = get_walk_forward_splits(
    o, 
    n_splits=4, 
    train_size=.6,
    valid_size=0.1, 
    test_size=0.1, 
    anchored = True,
    gap = 0.,
    test_after_valid = True,
    random_state = None,
    show_plot=True,
)

You can find the documentation here.

@oguiza oguiza reopened this Oct 21, 2022
@oguiza
Copy link
Contributor

oguiza commented Oct 21, 2022

@alitirmizi23 , if this is what you were looking for, pls feel free to close the issue.

@alitirmizi23
Copy link
Author

@oguiza amazing, thanks for the feature! Yes, this is what I was looking for. I will close this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants