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

Enhance the TimeSeriesSplit #4412

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Enhance the TimeSeriesSplit #4412

wants to merge 3 commits into from

Conversation

4rva
Copy link

@4rva 4rva commented Apr 18, 2024

Pull Request Description

Better use of guidelines and clarity using doctrings

This commit introduces several optimizations and enhancements to the TimeSeriesSplit class, designed to improve clarity, maintainability, and performance. The modifications ensure that the class remains fully functional and integrates smoothly with existing workflows while adhering to best practices in software development.

Key Changes:
- Streamlined parameter defaults: Ensured `forecast_horizon` defaults to 1 when unspecified to prevent undefined behaviors.
- Improved test size calculation: Refined the logic for calculating `test_size` to depend on whether `n_series` is provided, enhancing the flexibility and applicability of the class.
- Refined empty data handling: The split method now has clearer conditions for handling cases where either `X` or `y` are empty or None, ensuring robust behavior in edge cases.
- Enhanced validation: Integrated checks using `are_ts_parameters_valid_for_split` before proceeding with splits to ensure the parameters are appropriate for the data size and intended number of splits.
- Documentation improvements: Expanded and clarified docstrings throughout the class to provide better guidance and ensure the intentions and functionality of each component are well understood.

These changes aim to enhance the usability and effectiveness of the TimeSeriesSplit class in practical time series analysis scenarios.
Optimize and enhance TimeSeriesSplit class for clarity and performance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant