[Stack 16/17] Fix D15: match Clojure moderation handling (zero out columns, don't remove)#2523
Open
jucor wants to merge 1 commit intospr/edge/9ec28252from
Open
[Stack 16/17] Fix D15: match Clojure moderation handling (zero out columns, don't remove)#2523jucor wants to merge 1 commit intospr/edge/9ec28252from
jucor wants to merge 1 commit intospr/edge/9ec28252from
Conversation
This was referenced Mar 30, 2026
Open
775510c to
ae240ea
Compare
…emove) ## Summary Python's `_apply_moderation()` removed moderated-out comment columns entirely from `rating_mat`. Clojure's `zero-out-columns` (named_matrix.clj:214-230) sets all values in moderated columns to 0, preserving matrix structure. This fix changes Python to match: - Moderated-out comment columns are **zeroed** (values set to 0.0), not removed - `rating_mat` retains the same column count as `raw_rating_mat` - Moderated-out participants (rows) are still removed — unchanged ### Why zeroing matters - **Matrix dimensions**: Clojure's `rating-mat` has the same shape as `raw-rating-mat`. Downstream code (PCA, repness) processes the same-shaped matrix. - **tids list**: Column indices stay stable. Consumers depend on this. - **Practical impact**: Zeroed columns have no signal (na=0, nd=0), so they fail significance tests and are excluded from repness/consensus. PCA sees zero variance. ## Changes - `conversation.py`: `_apply_moderation()` — zero out columns instead of removing - `test_discrepancy_fixes.py`: 5 new synthetic tests + 2 enhanced real-data tests - `test_conversation.py`: Updated to expect zeroed columns ## Test plan - [x] Synthetic tests: zeroing preserves columns, values are 0, non-moderated unchanged - [x] Real-data test: biodiversity-incremental (169 mod-out comments) - [x] Full public test suite: 328 passed, 0 failed - [x] TDD cycle: RED (2 failures) → GREEN (all pass) 🤖 Generated with [Claude Code](https://claude.com/claude-code) ## Squashed commits - Fix D15: match Clojure moderation handling (zero out columns, don't remove) commit-id:c3450b9a
ae240ea to
6be5051
Compare
Delphi Coverage Report
|
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
Python's
_apply_moderation()removed moderated-out comment columns entirelyfrom
rating_mat. Clojure'szero-out-columns(named_matrix.clj:214-230) setsall values in moderated columns to 0, preserving matrix structure.
This fix changes Python to match:
rating_matretains the same column count asraw_rating_matWhy zeroing matters
rating-mathas the same shape asraw-rating-mat.Downstream code (PCA, repness) processes the same-shaped matrix.
significance tests and are excluded from repness/consensus. PCA sees zero variance.
Changes
conversation.py:_apply_moderation()— zero out columns instead of removingtest_discrepancy_fixes.py: 5 new synthetic tests + 2 enhanced real-data teststest_conversation.py: Updated to expect zeroed columnsTest plan
🤖 Generated with Claude Code
Squashed commits
commit-id:c3450b9a
Stack: