question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

re-factoring existing forecasters to new interface

See original GitHub issue

We need to slowly re-factor all forecasters to be compliant with the new interface (see PR #912). i.e., no overrides of fit etc and descendant classes only implementing core logic, while the BaseForecaster implements check etc logic.

Currently this is running due to various downwards compatibility workarounds, which should be removed once all forecasters are ready (in “no-override” state)

The forecasters that still need a downstream refactor are:

  • NaiveForecasters #953
  • EnsembleForecaster #977
  • MultiplexForecaster #977
  • TransformedTargetForecaster #977
  • _Reducer and related code #1031
  • StackingForecaster #977
  • ForecastingGridSearchCV, RandomizedGridSearchCV, and BaseGridSearch #1034
  • OnlineEnsembleForecaster and descendants #1015
  • _PmdArimaAdapter and descendants ARIMA, AutoARIMA #1016 - adapter only
  • BATS, TBATS, and _Tbatsadapter #1017 adapter only
  • _StatsModelAdapter and descendants AutoETS, ExponentialSmoothing, ThetaForecaster #1029
  • HCrystalBallForecaster #1004
  • Prophet and _ProphetAdapter #1005
  • PolynomialTrendForecaster #1003

For a how-to, useful resources are the forecaster extension template in extension_templates and PR #953 as an example for NaiveForecaster.

Based on discussions, we need to do the following two things in a capstone refactor that removes the last traces of the workarounds and goes over the above for consistency:

  • remove the _SktimeForecaster and mixins for good
  • go through all forecasters and check the tags for correctness

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:18

github_iconTop GitHub Comments

1reaction
Lovkush-Acommented, Jun 24, 2021

@fkiraly. As a third item, I suggest getting rid of _sktime.py altogether. The only things in there are _SktimeForecaster (to be deleted), the mixins (to be deleted) and _BaseWindowForecaster (which I suggest moving into _base.py).

I also suggest refactoring _BaseWindowForecaster but it is better to do that in #982 as BaseWindowForecaster predominantly deals with defining predicts and updates

0reactions
fkiralycommented, Jul 8, 2021

Yes, indeed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

5 Refactoring Techniques You Can Use To Improve Your ...
Discover five refactoring techniques to improve your existing code and the primary benefits of each method.
Read more >
Creating an Interface from Existing Methods - InformIT
In the Refactoring window, look at the preview of the code to be changed. If there is a modification that you do not...
Read more >
Extract Interface refactoring - ReSharper - JetBrains
This refactoring helps create a new interface based on a selected type. ReSharper suggests choosing members to be transferred to the new ......
Read more >
Extract an interface refactoring - Visual Studio - Microsoft Learn
Learn how to use the Quick Actions and Refactorings menu to create an interface by using existing members from a class, struct, ...
Read more >
Refactoring the Simple Blazor MVVM client - ITNEXT
We'll start with our daily forecast so go into the Models folder and create a new class DailyForecastModel.cs. The first thing we are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found