Skip to content

UmdTask758_MSML610_Fall2026_Distribution_Shift_in_Time_Series_Forecasting_2 - #1045

Open
farcypeer46 wants to merge 4 commits into
gpsaggese:masterfrom
farcypeer46:UmdTask758_MSML610_Fall2026_Distribution_Shift_in_Time_Series_Forecasting_2
Open

farcypeer46 wants to merge 4 commits into
gpsaggese:masterfrom
farcypeer46:UmdTask758_MSML610_Fall2026_Distribution_Shift_in_Time_Series_Forecasting_2

Conversation

@farcypeer46

Copy link
Copy Markdown

Part of #758 (Group 23). Builds on #1042.

Summary

  • Add the shift generators of the study: a shift with a known type, onset, and
    severity (0.25, 0.5, 1) is injected in a series, which keeps an unshifted twin
    on the same dates
    • Covariate shift: the series is multiplied by 1 + severity
    • Concept drift: the lag-1 dependence of the deseasonalized residual changes
    • Temporal shift: the seasonal pattern shrinks or flips
    • Label shift: clean windows are reweighted towards high targets
  • Synthetic series (level + weekly season + AR(1)) with a known oracle error, so a
    harder problem can be told apart from a worse model
  • The concept shift of real series uses only past values, so the future of the
    original series can't leak into the shifted one
  • Add the seven forecasters, with one interface (fit(train, period),
    predict(history, horizon, dates))
    • Seasonal Naive, AutoARIMA, Prophet, and an echo state network
    • Chronos-Bolt small, TimesFM 2.5, and Moirai 1.1 small, zero-shot, with the
      weights pinned to a revision
    • Two ablations that normalize each window (arima_scaled, esn_scaled)
  • Add the settings of the study (tsshift/config.py)
  • Format data.py and its test with the settings of the course repository
    (ruff.toml, line length 81)

Files

  • tsshift/shifts.py: shift generators, windows, and label weights
  • tsshift/models.py: the forecasters
  • tsshift/config.py: all the settings of the study
  • test/test_shifts.py: tests of the shifts and of three models (no data and no
    download needed)
  • tsshift/data.py, test/test_data.py: formatting only
  • ruff.toml: lint and format settings, the same as the course repository

How to test

> cd class_project/msml610/Fall2026/projects/UmdTask758_MSML610_Fall2026_Distribution_Shift_in_Time_Series_Forecasting
> pip install -r requirements.txt
> pytest
  • 35 tests pass (Python 3.12, fresh virtual environment, macOS Apple Silicon)
  • Among them: a shift changes nothing before its start, the shifted past does not
    depend on the future, and the models are deterministic

Notes

@Sohail-5678 @Delvitron1019 @gpsaggese could you please review? Thanks!

This branch has not been deployed

No deployments
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.

1 participant