Skip to content

[DOC] Add usage examples for TimeXer and TemporalFusionTransformer - #2444

Merged
phoeenniixx merged 2 commits into
sktime:mainfrom
atharva-mashalkar:docs-timexer-tft-examples
Oct 4, 2026
Merged

phoeenniixx merged 2 commits into
sktime:mainfrom
atharva-mashalkar:docs-timexer-tft-examples

Conversation

@atharva-mashalkar

@atharva-mashalkar atharva-mashalkar commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Reference Issues/PRs

Towards #2377 (adds the remaining v1 TimeXer and TemporalFusionTransformer items).

What does this implement/fix? Explain your changes.

Adds a runnable Examples section to the TimeXer and TemporalFusionTransformer class docstrings, in NumPy docstring style, following the merged xLSTMTime example: toy TimeSeriesDataSet, from_dataset(...), a fast_dev_run CPU Trainer, and predict.

TimeXer uses encoder length 16 and patch_length=8 so the context length is a multiple of the patch length.

The TFT class docstring already documents Parameters, so its Examples section is placed after that section.

What should a reviewer concentrate their feedback on?

  • TimeXer encoder length and patch_length
  • TemporalFusionTransformer hidden_size, attention_head_size, and hidden_continuous_size

Did you add any tests for the change?

No new tests; the examples are exercised by TestAllPtForecasters.test_doctest_examples.
Ran locally: pytest --doctest-modules on both model files (passed).

PR checklist

  • The PR title starts with [DOC]
  • Used pre-commit hooks on the changed files (pre-commit run --files)

Towards sktime#2377. These are the two remaining v1 models without a runnable
Examples section.
NumPy docstring order puts Examples last.
@codecov

codecov Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@11e0153). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2444   +/-   ##
=======================================
  Coverage        ?   88.81%           
=======================================
  Files           ?      218           
  Lines           ?    11671           
  Branches        ?        0           
=======================================
  Hits            ?    10366           
  Misses          ?     1305           
  Partials        ?        0           
Flag Coverage Δ
cpu 88.81% <ø> (?)
pytest 88.81% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@phoeenniixx
phoeenniixx merged commit 903e968 into sktime:main Oct 4, 2026
38 checks passed
@atharva-mashalkar
atharva-mashalkar deleted the docs-timexer-tft-examples branch October 4, 2026 13:36
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.

2 participants