Skip to content

[ENH] added update capability in GridSearchCV and RandomizedSearchCV#1053

Merged
fkiraly merged 1 commit into
sktime:mainfrom
patelchaitany:feature/tuner-update-capability
May 30, 2026
Merged

[ENH] added update capability in GridSearchCV and RandomizedSearchCV#1053
fkiraly merged 1 commit into
sktime:mainfrom
patelchaitany:feature/tuner-update-capability

Conversation

@patelchaitany
Copy link
Copy Markdown
Contributor

@patelchaitany patelchaitany commented May 21, 2026

Reference Issues/PRs

#1050

What does this implement/fix? Explain your changes.

This add the update capability for GridSearchCV and RandomizedSearchCV

BaseGridSearch:

  • Added update_behaviour="full_refit" parameter to init
  • Added "capability:update" to tags_to_clone so the tag propagates from the inner estimator
  • Added self._X, self._y, self._C storage at end of _fit() for data accumulation
  • Added _update() method with three strategies: "full_refit", "inner_only", "no_update"
  • Added _update_data() helper for concatenating old + new data

GridSearchCV:

  • Added update_behaviour parameter to init, passed through to super
  • Added update_behaviour docstring entry
  • Added test params with OnlineRefit-wrapped estimator

RandomizedSearchCV:

  • Same three changes as GridSearchCV (parameter, docstring, test params)

Does your contribution introduce a new dependency? If yes, which one?

No

What should a reviewer concentrate their feedback on?

Did you add any tests for the change?

Any other comments?

PR checklist

For all contributions
  • I've added myself to the list of contributors with any new badges I've earned :-)
    How to: add yourself to the all-contributors file in the skpro root directory (not the CONTRIBUTORS.md). Common badges: code - fixing a bug, or adding code logic. doc - writing or improving documentation or docstrings. bug - reporting or diagnosing a bug (get this plus code if you also fixed the bug in the PR).maintenance - CI, test framework, release.
    See here for full badge reference
  • The PR title starts with either [ENH], [MNT], [DOC], or [BUG]. [BUG] - bugfix, [MNT] - CI, test framework, [ENH] - adding or improving code, [DOC] - writing or improving documentation or docstrings.
For new estimators
  • I've added the estimator to the API reference - in docs/source/api_reference/taskname.rst, follow the pattern.
  • I've added one or more illustrative usage examples to the docstring, in a pydocstyle compliant Examples section.
  • If the estimator relies on a soft dependency, I've set the python_dependencies tag and ensured
    dependency isolation, see the estimator dependencies guide.

Copy link
Copy Markdown
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.

Thanks, good start!

Some change requests:

  • please do not store the data by default, this causes memory leaks in current code. Instead, make the default option the current one - no update happens - and only store data if a strategy is chosen that requires this.
  • No pull request is ready without docstrings. Please update the docstrings properly.

@patelchaitany patelchaitany force-pushed the feature/tuner-update-capability branch from f4d92ba to ead7a7f Compare May 27, 2026 15:17
@patelchaitany
Copy link
Copy Markdown
Contributor Author

Thanks for the review - both points are addressed

@patelchaitany patelchaitany force-pushed the feature/tuner-update-capability branch from ead7a7f to cfcd5f3 Compare May 27, 2026 15:42
@patelchaitany patelchaitany requested a review from fkiraly May 27, 2026 15:43
Copy link
Copy Markdown
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!

I think the tag capability:update is not correctly set though?

If full_refit, it should be True; if no_update, it should be False, If inner_only, it should be clone the tag of the inner estimator.

Currently, it is always cloned.

The class tag (in _tags) should be True, since for some setting of parameters the capability is True.

@patelchaitany patelchaitany force-pushed the feature/tuner-update-capability branch from cfcd5f3 to dea895d Compare May 29, 2026 06:11
@patelchaitany
Copy link
Copy Markdown
Contributor Author

Thanks @fkiraly for catching this. Sorry I overlooked the capability:update tagging in the first pass.

I have pushed a fix that sets the class tag to True in _tags and sets the instance tag from update_behaviour: False for no_update, True for full_refit, and clones from the inner estimator for inner_only.

Happy to adjust if anything else should change.

Copy link
Copy Markdown
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!

@fkiraly fkiraly changed the title [ENH] add update capability to GridSearchCV and RandomizedSearchCV [ENH] added update capability in GridSearchCV and RandomizedSearchCV May 30, 2026
@fkiraly fkiraly changed the title [ENH] added update capability in GridSearchCV and RandomizedSearchCV [ENH] added update capability in GridSearchCV and RandomizedSearchCV May 30, 2026
@fkiraly fkiraly merged commit 98672c0 into sktime:main May 30, 2026
39 checks passed
@patelchaitany patelchaitany deleted the feature/tuner-update-capability branch May 30, 2026 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement module:regression probabilistic regression module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants