Skip to content

Fix cross-validation with shared seasonality conditions - #2748

Open
Shubham-Padkonde wants to merge 1 commit into
facebook:mainfrom
Shubham-Padkonde:fix/shared-seasonality-cross-validation
Open

Shubham-Padkonde wants to merge 1 commit into
facebook:mainfrom
Shubham-Padkonde:fix/shared-seasonality-cross-validation

Conversation

@Shubham-Padkonde

Copy link
Copy Markdown

When two seasonalities share a condition column, cross-validation includes that column twice in its prediction frame. Prediction then raises ValueError: The truth value of a Series is ambiguous, even though fitting and manual prediction accept the model.

Deduplicate prediction columns while preserving their order. Add a regression with weekly and monthly seasonalities sharing one boolean condition, checking forecasts and observed values against manual predictions at two cutoffs.

Fixes #2029.

Validation: the new regression fails on the base revision and passes with the fix; all 28 diagnostics tests pass on Python 3.12/Linux, including sequential, thread, process, custom-executor and Dask paths. Pyrefly 0.50.0 passes. Tests load the current Python source with the precompiled CmdStan 2.37.0 model from the official Prophet 1.4.0 wheel; Stan source is unchanged. One existing pytest fixture deprecation warning remains. Windows execution was attempted but the model binary failed to load a runtime dependency; the successful validation is Linux only. No R code changes.

Prepared with OpenAI Codex assistance.

@meta-cla

meta-cla Bot commented Sep 16, 2026

Copy link
Copy Markdown

Hi @Shubham-Padkonde!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@meta-cla meta-cla Bot added the CLA Signed label Sep 17, 2026
@meta-cla

meta-cla Bot commented Sep 17, 2026

Copy link
Copy Markdown

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cross validation with multiple conditional seasonality not working

1 participant