[Stack 14/17] Fix D7: match Clojure repness metric formula (product of 4 signed values)#2521
Open
jucor wants to merge 1 commit intospr/edge/23c03d70from
Open
[Stack 14/17] Fix D7: match Clojure repness metric formula (product of 4 signed values)#2521jucor wants to merge 1 commit intospr/edge/23c03d70from
jucor wants to merge 1 commit intospr/edge/23c03d70from
Conversation
This was referenced Mar 30, 2026
Open
Open
cfd57d1 to
90838d7
Compare
d92e3f2 to
be320d5
Compare
…ues)
## Summary
Changes the representativeness metric from a weighted sum of absolutes to the
Clojure product formula (repness.clj:188-190).
**Before (Python):**
- agree_metric = `pa * (|pat| + |rat|)` — weighted sum, tolerant of weak factors
- disagree_metric = `(1 - pd) * (|pdt| + |rdt|)` — doubly wrong: uses `(1-pd)` and sum
**After (Clojure formula):**
- agree_metric = `ra * rat * pa * pat` — product of 4 signed values
- disagree_metric = `rd * rdt * pd * pdt` — product of 4 signed values
The product formula is more conservative: any factor near zero kills the entire
metric, requiring ALL dimensions (probability, significance, relative
representativeness) to be strong simultaneously.
The old disagree formula was doubly wrong:
1. Used `(1 - pd)` instead of `pd` — high metric when disagree probability is LOW
2. Used a weighted sum of absolutes instead of a signed product
No feature flag for the old formula — it has no defensible behavior.
## Test plan
- [x] 5 new D7 formula tests (agree product, disagree product, zero-kills-metric,
sign preservation, multiple known values)
- [x] Updated unit tests in test_repness_unit.py and test_old_format_repness.py
- [x] Full test suite passes (excluding DynamoDB/MinIO tests)
- [x] Private dataset tests pass (--include-local)
- [x] Golden snapshots re-recorded for all 7 datasets
🤖 Generated with [Claude Code](https://claude.com/claude-code)
## Squashed commits
- Add PR description and update plan/journal for D7 fix
commit-id:80eaa87c
90838d7 to
1390ff7
Compare
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
Changes the representativeness metric from a weighted sum of absolutes to the
Clojure product formula (repness.clj:188-190).
Before (Python):
pa * (|pat| + |rat|)— weighted sum, tolerant of weak factors(1 - pd) * (|pdt| + |rdt|)— doubly wrong: uses(1-pd)and sumAfter (Clojure formula):
ra * rat * pa * pat— product of 4 signed valuesrd * rdt * pd * pdt— product of 4 signed valuesThe product formula is more conservative: any factor near zero kills the entire
metric, requiring ALL dimensions (probability, significance, relative
representativeness) to be strong simultaneously.
The old disagree formula was doubly wrong:
(1 - pd)instead ofpd— high metric when disagree probability is LOWNo feature flag for the old formula — it has no defensible behavior.
Test plan
sign preservation, multiple known values)
🤖 Generated with Claude Code
Squashed commits
commit-id:80eaa87c
Stack: