Skip to content

Conversation

@anirudhsengar
Copy link

@anirudhsengar anirudhsengar commented Nov 16, 2025

Summary

Extend ForecastingOptCV to expose sktime’s broadcasting controls plus richer post-fit diagnostics, aligning it more closely with ForecastingGridSearchCV while keeping Hyperactive optimizers in play. Also document the new knobs and assert the behavior via integration tests.

Changes

  • Broadcasting flags: Added tune_by_instance/tune_by_variable init params. When sktime is available we reuse its delegated tagging (_set_delegated_tags + _extend_to_all_scitypes) so panel/multivariate broadcasting follows the native implementation rather than a bespoke copy.
  • Returned attributes: fit now records scorer_, n_splits_, best_index_, best_score_, best_params_, best_forecaster_, refit_time_, and a cv_results_ table (the backtesting results for the winning configuration). We time refits with time.perf_counter and keep the optimizer’s best index when available.
  • Docs & tests: README.md explains the new parameters/diagnostics. test_sktime_estimators.py gained regression tests to ensure the attributes populate and the tune-by flags adjust estimator tags.

Related Issues

Fixes #198

anirudhsengar and others added 3 commits November 16, 2025 08:27
… parameters

Signed-off-by: Anirudh Sengar <anirudhsengar3@gmail.com>
Signed-off-by: Anirudh Sengar <anirudhsengar3@gmail.com>
Copy link
Collaborator

@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Though, I think there is already automatic broadcasting in sktime - this should be activated, instead of reimplementing it.

Have a look at BaseGridSearch in sktime, and the __init__ code which handles tune_by_variable and tune_by_instance (the latter via _extend_to_all_scitypes).

@fkiraly fkiraly added enhancement New feature or request module:integrations Integrations for applying optimization to other libraries labels Nov 22, 2025
anirudhsengar and others added 3 commits November 23, 2025 16:28
Signed-off-by: Anirudh Sengar <anirudhsengar3@gmail.com>
Signed-off-by: Anirudh Sengar <anirudhsengar3@gmail.com>
Copy link
Collaborator

@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

Only very small comments above.

Signed-off-by: Anirudh Sengar <anirudhsengar3@gmail.com>
@anirudhsengar
Copy link
Author

Done! Thank you @fkiraly for the feedback.

@anirudhsengar
Copy link
Author

If approved, please merge sktime/sktime#9092 as well.

Copy link
Collaborator

@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

Small request - please move the example from the README to the docstring, and also update the docstring in sktime/sktime#9092 so it is identical.

@anirudhsengar
Copy link
Author

Done! @fkiraly. Even updated sktime/sktime#9092.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request module:integrations Integrations for applying optimization to other libraries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENH] extend sktime ForecastingOptCV with broadcasting options and returned parameters

2 participants