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

Merged
merged 3 commits into from
Feb 8, 2025

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
Copy link

codecov bot commented Feb 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.19%. Comparing base (d6371b5) to head (b1a86f4).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2666      +/-   ##
==========================================
- Coverage   94.25%   94.19%   -0.07%     
==========================================
  Files         141      141              
  Lines       15550    15552       +2     
==========================================
- Hits        14657    14649       -8     
- Misses        893      903      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dennisbader dennisbader merged commit 824fd70 into master Feb 8, 2025
9 checks passed
@dennisbader dennisbader deleted the fix/global_naive_model_support_properties branch February 8, 2025 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Released
Development

Successfully merging this pull request may close these issues.

1 participant