Skip to content

Add BATS and TBATS model adapters #678

Closed
1 task
iKintosh opened this issue May 11, 2022 · 0 comments · Fixed by #734
Closed
1 task

Add BATS and TBATS model adapters #678

iKintosh opened this issue May 11, 2022 · 0 comments · Fixed by #734
Assignees
Labels
enhancement New feature or request

Comments

@iKintosh
Copy link
Contributor

iKintosh commented May 11, 2022

🚀 Feature Request

Add new models to library.

Motivation

Should expand number of models in ETNA

Proposal

Add BATS and TBATS model adapters (use models from tbats library https://github.com/intive-DataScience/tbats)

Create _TBATSAdapter inherit it from BaseAdapter. It should implement methods fit, predict and get_model.

Also create _TBATSPerSegmentModel(PerSegmentPredictionIntervalModel) as a model it should expect class BATS or TBATS from tbats (also you may use Estimator).

After that create classes BATSPerSegmentModel and TBATSPerSegmentModel

To understand the idea look at the

class _SklearnAdapter(BaseAdapter):

class SklearnPerSegmentModel(PerSegmentModel):

class LinearPerSegmentModel(SklearnPerSegmentModel):

Test cases

  • not fitted model (should rise an error)
  • test repr
    def test_repr_linear(model_class, model_class_repr):
    """Check __repr__ method of LinearPerSegmentModel and LinearMultiSegmentModel."""
    kwargs = {"copy_X": True, "positive": True}
    kwargs_repr = "copy_X = True, positive = True"
    model = model_class(fit_intercept=True, **kwargs)
    model_repr = model.__repr__()
    true_repr = f"{model_class_repr}(fit_intercept = True, {kwargs_repr}, )"
    assert model_repr == true_repr
  • test on dummy dataset with two seasonality (combine two sinusoids)

Alternatives

No response

Additional context

Look at the sktime for inspiration https://github.com/alan-turing-institute/sktime/blob/2a0df3f52a6fe67f5509f6199cc60f01e3dc0adf/sktime/forecasting/tbats.py#L15

Checklist

  • I discussed this issue with ETNA Team
@iKintosh iKintosh added the enhancement New feature or request label May 11, 2022
@alex-hse-repository alex-hse-repository moved this to Specification in etna board May 16, 2022
@julia-shenshina julia-shenshina self-assigned this May 19, 2022
@alex-hse-repository alex-hse-repository moved this from Specification to Todo in etna board Jun 1, 2022
@martins0n martins0n moved this from Todo to In Progress in etna board Jun 6, 2022
@martins0n martins0n moved this from In Progress to In Review in etna board Jun 6, 2022
@julia-shenshina julia-shenshina mentioned this issue Jun 8, 2022
9 tasks
Repository owner moved this from In Review to Done in etna board Jun 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants