Skip to content

Grid/random search forecaster using dynamic tags to check for fh#1091

Merged
fkiraly merged 29 commits intomainfrom
forecasting-refactor-capstone-with-dynamic-tags
Aug 29, 2021
Merged

Grid/random search forecaster using dynamic tags to check for fh#1091
fkiraly merged 29 commits intomainfrom
forecasting-refactor-capstone-with-dynamic-tags

Conversation

@fkiraly
Copy link
Copy Markdown
Collaborator

@fkiraly fkiraly commented Jul 1, 2021

This is a refactor of the below refactor.

Parts of this have now been merged as part of other PR. So in effect, this PR only makes one major change:

  • in concrete grid search classes, overrides the "requires-fh-in-fit" tag in the constructor of the grid search algorithms with the value of the single component (the tuned estimator), using clone_tags.

A minor change is docstring linting in _tune.


This is a follow-on from #1088 attempting to address the incompatibility of the grid search refactor due to its "dynamic tag like" behaviour pre-refactor.

Apologies from working with the tags here, but this naturally emerged in trying to address issues and finish the forecaster refactor.

The solution I've adopted makes the following changes to the grid search algorithms:

  • in concrete grid search classes, overrides the "requires-fh-in-fit" tag in the constructor of the grid search algorithms with the value of the single component (the tuned estimator)
  • in BaseGridSearch, completes the refactor by moving all algorithmic logic to the _fit, _predict etc interface. This includes removing the override to the cutoff getter.

The first change, the override, is achived by new dynamic tag handling (object, not class) methods in the BaseEstimator class: getters get_tags, get_tag and setters set_tags and mirror_tags. These make use of dynamic tags that can be set in construction and override class tags and their inheritance.

The one other change is replacing the tag access in _set_fh by get_tag so it can see the dynamic tag override.

@fkiraly
Copy link
Copy Markdown
Collaborator Author

fkiraly commented Jul 1, 2021

FYI @GuzalBulatova

@fkiraly fkiraly added the module:forecasting forecasting module: forecasting, incl probabilistic and hierarchical forecasting label Jul 1, 2021
@fkiraly
Copy link
Copy Markdown
Collaborator Author

fkiraly commented Jul 1, 2021

@GuzalBulatova, @mloning, @TonyBagnall, if you remember we went back and forth about _update etc in the grid search.
This is now almost identical with the middle stage (except for the dynamic tag on fh use), please have a look whether it makes sense.

@fkiraly fkiraly changed the title Forecasting refactor capstone with dynamic tags to address grid search failure Grid/random search forecaster using dynamic tags to check for fh Jul 20, 2021
@fkiraly
Copy link
Copy Markdown
Collaborator Author

fkiraly commented Aug 27, 2021

@aiwalter, can you have a look? This relates to your change on OptionalPassthrough.

Are there any other tags we want to mirror? All of them, perhaps?

@fkiraly fkiraly merged commit fb826e3 into main Aug 29, 2021
@fkiraly fkiraly deleted the forecasting-refactor-capstone-with-dynamic-tags branch August 29, 2021 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module:forecasting forecasting module: forecasting, incl probabilistic and hierarchical forecasting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants