Repository navigation
1258: Remove partly missing multivariate forecasts before scoring - #1280
Draft
nikosbosse wants to merge 3 commits into
Draft
nikosbosse wants to merge 3 commits into
nikosbosse wants to merge 3 commits into
Conversation
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1280 +/- ##
==========================================
+ Coverage 99.18% 99.19% +0.01%
==========================================
Files 41 41
Lines 2331 2364 +33
==========================================
+ Hits 2312 2345 +33
Misses 19 19 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
A multivariate forecast is now removed only if it lost a forecast unit or if its remaining samples are not available for all forecast units. One helper, called after validation, replaces the two previous ones. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
8 of 9 tasks
This branch has not been 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.
CLAUDE:
Description
This PR closes #1258.
score()removes rows withNAvalues after the forecast has been validated. For multivariate forecasts this could remove a part of a joint forecast, which was then scored with fewer dimensions, or split one joint forecast into several (a single missing sample turned a two-dimensional forecast into two one-dimensional "energy scores").score()for multivariate sample and multivariate point forecasts now checks, after rows withNAvalues have been removed, whether each multivariate forecast is still complete: no forecast unit may have been lost, and for sample forecasts every remaining sample id must be available for every forecast unit. Forecasts that are incomplete are removed entirely, with a warning that says how many were removed and names their.mv_group_id. If no forecast is left,score()errors.Not affected:
Design choice: if a sample is missing for only some forecast units, the whole joint forecast is removed. Removing that sample id from all forecast units would keep more data, but would silently score the forecast with fewer samples than supplied; I kept the more conservative rule.
One existing test changed: "score() preserves scale column for multivariate forecasts" applied
sqrt()to the example data, which contain a negative observation. The resultingNaNmade 9 joint forecasts incomplete on the sqrt scale, and the test passed only because they were scored on the remaining three locations. The test now usessqrt(pmax(x, 0)).Checklist
lintr::lint_package()to check for style issues introduced by my changes. Linted the changed files, no lints.Adversarial review
An independent agent reviewed the first version of this PR. It confirmed that every remaining score equals the score of that forecast scored alone, that
score()on the example data and all vignette outputs are identical tomain, and that the edit to the existing transform test is justified (the original test passes onmainonly because nine incomplete forecasts were scored on three of four locations).Addressed:
NArow, including a forecast in which the same sample is missing everywhere, which is still complete. Completeness is now judged afterNAremoval..mv_group_idvalues.🤖 Generated with Claude Code