feat: add scoring.uncertainty_score for Beta differential entropy (#195) - #269
Conversation
Adds uncertainty_score(alpha, beta) -> float computing H(α, β) = ln B(α,β) − (α−1)·ψ(α) − (β−1)·ψ(β) + (α+β−2)·ψ(α+β) via stdlib math.lgamma and a recurrence+asymptotic digamma approximation (~1e-10 accuracy for x ≥ 6). No third-party dependencies. Adds 11 property and numeric-sanity tests in tests/test_scoring.py.
146762a to
00887fc
Compare
|
Status check: rebased onto current main (single clean commit).
This needs a |
## Summary - `history-scan` was using `git log --all --remotes='origin/*'`, so any pattern that landed in `main` would block every subsequent PR. - Scope the scan to `merge-base(origin/<base>, HEAD)..HEAD` — only commits this PR adds. - Pattern enforcement on incoming changes is preserved; legitimate identifiers already in `main` no longer cause cross-PR spillover. ## Test plan - [ ] CI runs the new `history-scan` step on this PR and passes. - [ ] Re-run a previously-failing PR (e.g. #268, #269) after merge to confirm the spillover is gone. Closes #272
|
Review: diff is clean — single self-contained Hold: history-scan is the only red, same cluster blocker on most open PRs. Not merging until that goes green; once it does, this PR is ready. Dropping |
Closes #195. Ratified substrate context: single-axis Beta-Bernoulli (Option B, #196).
Summary
uncertainty_score(alpha, beta) -> floattosrc/aelfrice/scoring.pyH(α,β) = ln B(α,β) − (α−1)·ψ(α) − (β−1)·ψ(β) + (α+β−2)·ψ(α+β)tests/test_scoring.py: known values (uniform/Jeffreys/symmetric), maximum at α=β=1 over [1,10]², monotonicity along β=1 edge and symmetric diagonal, symmetry, finitenessTest plan
uv run pytest tests/test_scoring.py -v— 11 passed