Skip to content

Example on multiple targets (with proposed solution) #1440

Open
@svnv-svsv-jm

Description

@svnv-svsv-jm
  • PyTorch-Forecasting version: 1.0.0
  • PyTorch version: 2.1.0
  • Python version: 3.10.10
  • Operating System: OS X

There is currently no example about how to set up any model to predict multiple targets (auto-regressively).

targets = ['col1', 'col2', ...]

dataset_ts = TimeSeriesDataSet(
    df,
    time_idx="time_idx",
    target=targets,
    group_ids=["group"],
    time_varying_unknown_reals=targets,
    target_normalizer=MultiNormalizer([TorchNormalizer() for _ in targets]),
)

My targets are also the input to the model, as it is an auto-regressive use case.

I've update the code, see my comments below. Now it will work with multi-targets! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions