fix: validate quantile_by_key in arx_forecaster() and flatline_forecaster() (#229)#481
Open
gregfaletto wants to merge 2 commits into
Open
fix: validate quantile_by_key in arx_forecaster() and flatline_forecaster() (#229)#481gregfaletto wants to merge 2 commits into
quantile_by_key in arx_forecaster() and flatline_forecaster() (#229)#481gregfaletto wants to merge 2 commits into
Conversation
…er (cmu-delphi#229) arx_forecaster() and flatline_forecaster() now error at the forecaster boundary when quantile_by_key contains columns that are not in key_colnames(epi_data), instead of silently dropping them downstream. For flatline_forecaster() in particular the layer-level warning was invisible because forecast(wf) is wrapped in suppressWarnings(), so users got no signal at all on invalid input. Also adds a warning when arx_forecaster() is called with a quantile- output trainer (quantile_reg() or rand_forest with engine "grf_quantiles") plus a non-empty quantile_by_key. The argument is silently dropped in that code branch; the warning surfaces the no-op without breaking working code. The 2023 headline failure (flatline crashing on a valid key) no longer reproduces - residuals.flatline carries geo_value through and the call works cleanly. cdc_baseline_forecaster uses a different layer with the same parallel-structure vulnerability; deferred to a follow-up issue. Version bumped 0.2.5 -> 0.2.7 (skipping 0.2.6 for the open PR cmu-delphi#480 collision). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Switches the version bump for cmu-delphi#229 from 0.2.7 to 0.2.6 so the maintainer can choose the merge order against the still-open PR cmu-delphi#480 (doc regen, also targeting 0.2.6). Whichever PR merges first claims 0.2.6; the other rebases to 0.2.7 at merge time. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Resolves #229.
arx_forecaster()andflatline_forecaster()now error at the forecaster boundary whenquantile_by_keycontains columns that are not inkey_colnames(epi_data), instead of silently dropping them downstream —flatline_forecaster()'ssuppressWarnings(forecast(wf))wrapper made the layer's warning invisible. Also adds a warning whenarx_forecaster()is called with a quantile-output trainer (quantile_reg()orrand_forest(engine = "grf_quantiles")) plus a non-emptyquantile_by_key— the argument is silently dropped in that branch.The 2023 headline failure (flatline crashing on
quantile_by_key = "geo_value") no longer reproduces —residuals.flatlinecarries the key through, and the call now works cleanly.cdc_baseline_forecasteruses a different layer (layer_cdc_flatline_quantiles) with the same parallel-structure vulnerability; deferred to a follow-up issue.Version bumped 0.2.5 → 0.2.6. All checks clean (
devtools::test()916/0/2;devtools::check()0 errors with the same WARNING/NOTE baseline as recent merged PRs).