Made 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.
Made 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:
forecast_horizon
defaults to 1 when unspecified to prevent undefined behaviors.test_size
to depend on whethern_series
is provided, enhancing the flexibility and applicability of the class.X
ory
are empty or None, ensuring robust behavior in edge cases.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.These changes aim to enhance the usability and effectiveness of the TimeSeriesSplit class in practical time series analysis scenarios.