Skip to content

Exemplary concrete estimator refactor post interface refactor, of NaiveForecaster#953

Merged
fkiraly merged 2 commits intomainfrom
refactor-interface-naiveforecaster
Jun 18, 2021
Merged

Exemplary concrete estimator refactor post interface refactor, of NaiveForecaster#953
fkiraly merged 2 commits intomainfrom
refactor-interface-naiveforecaster

Conversation

@fkiraly
Copy link
Collaborator

@fkiraly fkiraly commented Jun 12, 2021

This is an exemplary refactor of a concrete estimator class, NaiveForecaster, to explore how general concrete forecaster refactors would work, along the lines discussed in #912.

This PR changes:

  • _BaseWindowForecaster still inherits from BaseForecaster directly, and already looked extension spec compliant (no overrides, no tags)
  • NaiveForecaster inherits from _BaseWindowForecaster, and has been made extension spec compliant by adding the requires-fh-in-fit tag, and moving core logic from fit to _fit, while avoiding to override fit
  • it adds one line in BaseForecaster.fit, as a general change: the cutoff is set to the latest y index using _set_cutoff. This is done pre-_fit, which could override the set cut-off.

@fkiraly fkiraly requested a review from mloning as a code owner June 12, 2021 20:12
@fkiraly fkiraly requested a review from aiwalter June 12, 2021 20:12
@fkiraly
Copy link
Collaborator Author

fkiraly commented Jun 17, 2021

@mloning, @aiwalter, would one of you mind having at least a superficial look at this? @thayeylolu is following the same pattern in #965, so it would be good to get aligned on "is this good" better earlier than later. Sorry for being pushy...

Copy link
Contributor

@mloning mloning left a comment

Choose a reason for hiding this comment

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

Thanks @fkiraly - this looks good and very easy now given your refactoring in #912.

@fkiraly fkiraly merged commit 69b5a64 into main Jun 18, 2021
@fkiraly fkiraly deleted the refactor-interface-naiveforecaster branch June 18, 2021 22:36
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.

2 participants