Skip to content

Fix TFT fit_from_dataset future covariate validation#3149

Open
kiwoongyoon wants to merge 2 commits into
unit8co:masterfrom
kiwoongyoon:gitcontribute/20260629-153333-149077-unit8co-darts-issue-3008
Open

Fix TFT fit_from_dataset future covariate validation#3149
kiwoongyoon wants to merge 2 commits into
unit8co:masterfrom
kiwoongyoon:gitcontribute/20260629-153333-149077-unit8co-darts-issue-3008

Conversation

@kiwoongyoon

@kiwoongyoon kiwoongyoon commented Jun 29, 2026

Copy link
Copy Markdown

Fix TFT fit_from_dataset future covariate validation

Summary

  • Raise the existing TFT future-covariate ValueError during _create_model() when a custom training dataset has no future covariates and add_relative_index=False.
  • Add a regression assertion covering TFTModel.fit_from_dataset() with SequentialTorchTrainingDataset.

Test evidence

  • UV_PROJECT_ENVIRONMENT=/tmp/gitcontribute-darts-issue-3008-venv uv run --with '.[torch]' --with pytest python -m pytest darts/tests/models/forecasting/test_TFT.py::TestTFTModel::test_future_covariate_handling -q passed: 1 passed, 4 warnings in 10.87s.
  • git diff --check passed.
  • python -m py_compile darts/models/forecasting/tft_model.py darts/tests/models/forecasting/test_TFT.py passed.

Risks or notes for maintainers

  • The error message is duplicated with the existing _build_train_dataset() validation to keep this patch narrowly scoped.
  • Full test suite was not run; the targeted TFT regression test passed with project torch dependencies installed through uv.

Fixes #3008

@kiwoongyoon kiwoongyoon changed the title GitContribute issue #3008 Fix TFT fit_from_dataset future covariate validation Jun 29, 2026
@kiwoongyoon kiwoongyoon marked this pull request as ready for review June 29, 2026 15:47
@kiwoongyoon kiwoongyoon requested a review from dennisbader as a code owner June 29, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] TFTModel creation doesn't raise exception from model.fit_from_dataset and empty future covariates

1 participant