Skip to content

Add StackingEnsemble class #120

Closed
3 tasks done
iKintosh opened this issue Sep 30, 2021 · 2 comments · Fixed by #195
Closed
3 tasks done

Add StackingEnsemble class #120

iKintosh opened this issue Sep 30, 2021 · 2 comments · Fixed by #195
Assignees
Labels
enhancement New feature or request

Comments

@iKintosh
Copy link
Contributor

iKintosh commented Sep 30, 2021

🚀 Feature Request

StackingEnsemble is a class that combines results from several Pipelines.
It uses meta model for combination.

The logic of this Ensemble follows https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.StackingRegressor.html#sklearn.ensemble.StackingRegressor

Motivation

Make Ensembles in etna-ts even more useful

Proposal

Because we need to train our meta model we ought to use backtest.
The algorithm is assumed to be as follows:

  1. Initialise StackingEnsemble using model as final model, and cv. The cv could be None, Number. CV could be 2 and higher. By default cv=3.
  2. During fit all pipelines are run through backtest to get predictions.
  3. Then final model is trained on the predictions
  4. Finally pipelines are trained on whole dataset
  5. During forecast pipelines return predictions and then its runs through final_model
se = StackingEnsemble([Pipeline1, Pipeline2], horizon = 7, final_model=Model, cv=None)
se.fit(data)
se.forecast()

In case where Pipeline1 and Pipeline2 have different horizon parameter, StackingEnsemble should return error saying that horizons should be equal.

Test cases

No response

Alternatives

No response

Additional context

No response

Checklist

  • Added feature request
  • Added motivation
  • Added proposal
@iKintosh iKintosh added the enhancement New feature or request label Sep 30, 2021
@martins0n
Copy link
Contributor

We've already have features in our forecasts. And we shoud use them for our metamodel. Some features definitely should boost total score (segment class or daytime feature, for example)
ToBe:

se = StackingEnsemble([Pipeline1, Pipeline2], final_model=Model, cv=None, features_to_use: Union[None, Literal[all], List[str] = None)

If all have been chosen we fit model on targets + feature union.

@iKintosh iKintosh added the size:5 label Oct 5, 2021
@alex-hse-repository alex-hse-repository self-assigned this Oct 8, 2021
@julia-shenshina
Copy link
Contributor

is blocked by #121

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants