Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix global naive models cannot be used in ensemble models #2666

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dennisbader
Copy link
Collaborator

@dennisbader dennisbader commented Feb 7, 2025

Checklist before merging this PR:

  • Mentioned all issues that this PR fixes or addresses.
  • Summarized the updates of this PR under Summary.
  • Added an entry under Unreleased in the Changelog.

Fixes an issue mentioned on gitter where Global Naive models could not be used in ensemble models.

Code to reproduce below.

Summary

  • Fixed a bug where global naive models could not be used in ensemble models
  • Fixed a bug with global naive models where some supports_* properties were wrongly defined as methods.

Additional Info

Code to reproduce the issue:

import numpy as np

from darts.datasets import AirPassengersDataset
from darts.models import NaiveEnsembleModel, GlobalNaiveDrift

series = AirPassengersDataset().load().astype(np.float32)

model = NaiveEnsembleModel(
    forecasting_models=[
        GlobalNaiveDrift(input_chunk_length=12, output_chunk_length=12).fit(series)
    ],
    train_forecasting_models=False,
)
pred_kwargs = {"predict_likelihood_parameters": True, "verbose": True}
model.predict(n=12, series=series, **pred_kwargs)

@dennisbader dennisbader changed the title convert some supports_* methods to properties Fix global naive models cannot be used in ensemble models Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In review
Development

Successfully merging this pull request may close these issues.

1 participant