Skip to content

fix: support statsmodels 0.15 in naive forecasters - #1587

Merged
Li Jiang (thinkall) merged 2 commits into
microsoft:mainfrom
thinkall:fix/statsmodels-015-simple-exp-smoothing
Sep 7, 2026
Merged

fix: support statsmodels 0.15 in naive forecasters#1587
Li Jiang (thinkall) merged 2 commits into
microsoft:mainfrom
thinkall:fix/statsmodels-015-simple-exp-smoothing

Conversation

@thinkall

Copy link
Copy Markdown
Collaborator

Why are these changes needed?

Statsmodels 0.15.0 was released on August 27 and changed SimpleExpSmoothing so its wrapper still supplies initialization_method=None while the base ExponentialSmoothing constructor now requires a string. FLAML's naive and snaive estimators consequently fail with TypeError: initialization_method must be a string.

This failure reproduces on scheduled builds of main and is also the cause of the failing build matrix in #1568 (and newer unrelated PRs), so it is not introduced by those PR changes.

What does this PR do?

  • Passes initialization_method="estimated" explicitly when constructing SimpleExpSmoothing, preserving the documented pre-0.15 default behavior.
  • Adds a regression test that verifies FLAML always supplies the explicit initialization method.

Verification

  • pytest test/automl/test_forecast.py::test_simple_forecaster_sets_initialization_method -q
  • pre-commit run --files flaml/automl/time_series/ts_model.py test/automl/test_forecast.py

Pass the estimated initialization method explicitly because Statsmodels 0.15's SimpleExpSmoothing wrapper defaults to None while its base class now requires a string. Add a regression test to keep the constructor argument explicit.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused compatibility fix is correct and adequately covered by a regression test.

Pull request overview

Adds Statsmodels 0.15 compatibility for FLAML’s naive forecasters.

Changes:

  • Explicitly uses estimated initialization for SimpleExpSmoothing.
  • Adds regression coverage verifying the initialization method.
File summaries
File Description
flaml/automl/time_series/ts_model.py Configures explicit smoothing initialization.
test/automl/test_forecast.py Tests the supplied initialization method.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@thinkall
Li Jiang (thinkall) merged commit d83380a into microsoft:main Sep 7, 2026
13 checks passed
@thinkall
Li Jiang (thinkall) deleted the fix/statsmodels-015-simple-exp-smoothing branch September 7, 2026 07:19
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.

3 participants