Skip to content

[BUG] NaiveEnsembleModel predictions have wrong component names #1601

@DavidKleindienst

Description

@DavidKleindienst

Describe the bug
Predictions should have the same component names as the TimeSeries used to fit the model.
For NaiveEnsembleModel.predict that's not the case - The component of the returned TimeSeries is always called "0"

To Reproduce

import pandas as pd
import numpy as np
from darts import TimeSeries
from darts.models import NaiveEnsembleModel, NaiveMean

dates = pd.date_range("2020-01-01", "2020-12-31", freq = "D")
nr_dates = len(dates)
ts=TimeSeries.from_times_and_values(dates, 3*np.ones(nr_dates), columns=["TS"])
model = NaiveEnsembleModel([NaiveMean()])
model.fit(ts)
prediction = model.predict(10)
assert ts.components == prediction.components

raises an AssertionError

Expected behavior
No assertion error should be raised

System (please complete the following information):

  • Python version: 3.10
  • darts version 0.23.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageIssue waiting for triaging

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions