Skip to content

FEAT TFC-API solver: thread static/hist/future covariates to the SDK#47

Open
felixdivo wants to merge 1 commit into
benchopt:mainfrom
felixdivo:feat/tfc-api-covariates
Open

FEAT TFC-API solver: thread static/hist/future covariates to the SDK#47
felixdivo wants to merge 1 commit into
benchopt:mainfrom
felixdivo:feat/tfc-api-covariates

Conversation

@felixdivo

Copy link
Copy Markdown
Contributor

What

The TFC-API solver previously ignored ForecastInput.covariates and sent only the
bare target series (resolving the TODO in solvers/tfc_api.py). It now forwards
static / historical / future covariates to The Forecasting Company SDK as extra
train_df columns, declared via the SDK's static_variables / historical_variables /
future_variables parameters — in both the batched and per-series cross_validate paths.

Why

The Enedis dataset already populates covariates (hist_covars (T,1),
future_covars (T,2)), but no solver consumed them. This wires up the missing link so
exogenous-aware models (chronos-2, moirai-2, tfc-global, …) can use them.

How

  • Per-series covariate arrays become per-unique_id columns. Time-varying covariates span
    the full series timeline, so cross_validate reads each cutoff's future-covariate values
    directly from train_df (no separate future_df).
  • Static covariates broadcast to constant columns; time-varying ones are validated to align
    with x (clear ValueError otherwise).
  • Datasets without covariates (e.g. Monash) carry empty sequences ⇒ empty variable lists ⇒
    the call is unchanged. Whether a model actually consumes a covariate kind is left to the SDK.

Verified live against the real chronos-2 endpoint (covariate columns accepted, well-formed
forecast returned); covered in CI by the existing benchopt integration tests.

The TFC-API solver previously ignored ForecastInput.covariates and sent
only the bare target series. Forward static / historical / future
covariates as extra train_df columns, named via the SDK's
static_variables / historical_variables / future_variables parameters,
in both the batched and per-series cross_validate paths.

Time-varying covariates span the full series timeline, so cross_validate
reads each cutoff's future-covariate values straight from train_df (no
future_df needed). Datasets without covariates (e.g. Monash) carry empty
sequences, so the variable lists are empty and behaviour is unchanged.
Whether a given model consumes a covariate kind is left to the SDK.

This lets the Enedis dataset (the only one populating covariates today)
actually exercise exogenous-aware models. Coverage comes from the
benchopt integration tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@felixdivo felixdivo requested a review from GeoffNN June 13, 2026 12:45
@felixdivo felixdivo self-assigned this Jun 13, 2026
@felixdivo felixdivo added the enhancement New feature or request label Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant