Skip to content

feat: add incremental inference helper#2255

Open
gyx09212214-prog wants to merge 1 commit into
microsoft:mainfrom
gyx09212214-prog:codex/incremental-predict-helper
Open

feat: add incremental inference helper#2255
gyx09212214-prog wants to merge 1 commit into
microsoft:mainfrom
gyx09212214-prog:codex/incremental-predict-helper

Conversation

@gyx09212214-prog

Copy link
Copy Markdown

Summary

Adds a lightweight helper for users who update their local qlib data themselves and only need predictions for newly available dates.

The new helper configures an existing DatasetH so the handler loading window includes the required historical warmup rows while the prediction segment stays limited to the incremental date range. For TSDatasetH, the warmup length is inferred from step_len - 1 unless hist_ref is provided explicitly.

Fixes #2073.

Changes

  • Add get_inference_hist_ref, get_incremental_inference_config, and prepare_incremental_inference_dataset in qlib.workflow.online.update.
  • Reuse the same incremental window helper inside DSBasedUpdater.prepare_data to keep the existing online updater behavior aligned with the public helper.
  • Document the lightweight incremental prediction workflow in the online component docs.
  • Add regression coverage for warmup-window calculation, dataset configuration, TSDatasetH warmup inference, and validation errors.

Validation

  • python -m py_compile qlib\workflow\online\update.py tests\rolling_tests\test_incremental_inference.py
  • git diff --check

I also attempted python -m pytest tests\rolling_tests\test_incremental_inference.py -q locally on Windows. Collection is blocked before the new tests run because the source checkout does not have the compiled qlib Cython extension (qlib.data._libs.rolling), and building it requires Microsoft Visual C++ Build Tools in this environment.

@gyx09212214-prog gyx09212214-prog marked this pull request as ready for review June 12, 2026 16:05
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.

How to incrementally predict for incremental data?

1 participant