Fix cross-validation with shared seasonality conditions - #2748
Shubham-Padkonde wants to merge 1 commit into
Conversation
|
Thank you for your pull request and welcome to our community. Action RequiredIn 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. ProcessIn 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 If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
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.