FEAT TFC-API solver: thread static/hist/future covariates to the SDK#47
Open
felixdivo wants to merge 1 commit into
Open
FEAT TFC-API solver: thread static/hist/future covariates to the SDK#47felixdivo wants to merge 1 commit into
felixdivo wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The
TFC-APIsolver previously ignoredForecastInput.covariatesand sent only thebare target series (resolving the TODO in
solvers/tfc_api.py). It now forwardsstatic / historical / future covariates to The Forecasting Company SDK as extra
train_dfcolumns, declared via the SDK'sstatic_variables/historical_variables/future_variablesparameters — in both the batched and per-seriescross_validatepaths.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 soexogenous-aware models (chronos-2, moirai-2, tfc-global, …) can use them.
How
unique_idcolumns. Time-varying covariates spanthe full series timeline, so
cross_validatereads each cutoff's future-covariate valuesdirectly from
train_df(no separatefuture_df).with
x(clearValueErrorotherwise).the call is unchanged. Whether a model actually consumes a covariate kind is left to the SDK.
Verified live against the real
chronos-2endpoint (covariate columns accepted, well-formedforecast returned); covered in CI by the existing benchopt integration tests.