Repository navigation
[timeseries] Accept seasonal_period in TimeSeriesScorer.__call__ with a deprecation warning - #5957
Merged
shchur merged 1 commit intoNov 10, 2026
Conversation
nicoloangileri
had a problem deploying
to
integration-tests
October 7, 2026 12:25 — with
GitHub Actions
Failure
Contributor
Author
|
Hi @shchur, a gentle ping on this one when you have a moment. It restores |
Contributor
Author
Contributor
Author
|
Hi @shchur, checking in once more on this one. It restores |
… a deprecation warning
shchur
force-pushed
the
fix/scorer-seasonal-period-deprecation
branch
from
November 9, 2026 17:11
1f9be07 to
ce44d76
Compare
Collaborator
|
Thanks @nicoloangileri, will merge this after CI passes |
shchur
approved these changes
Nov 10, 2026
shchur
approved these changes
Nov 10, 2026
Contributor
This branch was successfully deployed
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.
Issue #, if available: none
Description of changes:
#5084 (horizon weights) moved both
prediction_lengthandseasonal_periodfromTimeSeriesScorer.__call__to the constructor. Passingprediction_lengthto__call__still works and emits aFutureWarning. Passingseasonal_periodthere, as code written for earlier versions does, now fails with an error that doesn't point at the cause:This happens because
seasonal_periodstays in**kwargsand reachessave_past_metrics()next to the explicitseasonal_period=argument.This PR handles it the same way as
prediction_length: it emits aFutureWarning("deprecated and will be removed in v2.0"), setsself.seasonal_period, and removes the key fromkwargs. The result is the same as constructing the metric withseasonal_period=....Tests:
test_when_seasonal_period_passed_to_call_then_warning_is_raised_and_value_matches_initfor MASE, RMSSE and SQL. It checks the warning and that the value equals the one fromseasonal_periodin the constructor.DUMMY_TS_DATAFRAMEis hourly (default seasonality 24), so the test also fails if the argument were dropped instead of applied. Onmasterit fails with theTypeErrorabove.timeseries/tests/unittests/test_metrics.py: 268 passed.ruff checkandruff format --checkpass.While checking this I also compared MAE, MSE, RMSE, MAPE, SMAPE, WAPE, MASE, RMSSE, WQL, SQL and MQL against their documented formulas on series with missing past values and a seasonal period of 3, and all of them matched.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.