BOT: Fix #193: Add sd_sample() and iqr_sample() sharpness metrics#1103
Draft
nikosbosse wants to merge 1 commit intomainfrom
Draft
BOT: Fix #193: Add sd_sample() and iqr_sample() sharpness metrics#1103nikosbosse wants to merge 1 commit intomainfrom
nikosbosse wants to merge 1 commit intomainfrom
Conversation
Add standard deviation and interquartile range as new sharpness metrics for sample-based forecasts, following the existing mad_sample() pattern. Both are observation-independent and included in the default metric list for forecast_sample objects. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1103 +/- ##
=======================================
Coverage 97.83% 97.84%
=======================================
Files 35 35
Lines 1845 1853 +8
=======================================
+ Hits 1805 1813 +8
Misses 40 40 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
nikosbosse
commented
Feb 13, 2026
Collaborator
Author
nikosbosse
left a comment
There was a problem hiding this comment.
CLAUDE: Automated review — APPROVE. Clean, minimal implementation of sd_sample() and iqr_sample() that correctly follows the established mad_sample() pattern. All 11 test specs implemented and passing. No issues found — functions, docs, exports, imports, and metric registration are all correct.
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.
Summary
sd_sample()andiqr_sample()as new sharpness metrics for sample-based forecastsmad_sample()pattern: observation-independent, row-wiseapply()over the predicted matrixget_metrics.forecast_sample()under names"sd"and"iqr"Fixes #193
Root cause
Only
mad_sample()existed as a dedicated sharpness metric. The issue requested standard deviation and IQR as additional spread measures.What the fix does
sd_sample(observed = NULL, predicted, ...)usingapply(predicted, 1, sd)iqr_sample(observed = NULL, predicted, ...)usingapply(predicted, 1, IQR)get_metrics.forecast_sample()@exportTest coverage added
observed = NULLhandlingpredictedscore()integrationapply()-based computationTest plan
🤖 Generated with Claude Code