Skip to content

Fix observation ensemble top-k tie handling#889

Closed
FlorianPfaff wants to merge 2 commits into
mainfrom
fix-observation-ensemble-topk-ties
Closed

Fix observation ensemble top-k tie handling#889
FlorianPfaff wants to merge 2 commits into
mainfrom
fix-observation-ensemble-topk-ties

Conversation

@FlorianPfaff

Copy link
Copy Markdown
Member

Summary

  • patch observation-ensemble top-k metrics to use stable exact-k tie handling via np.argsort(-p, kind="mergesort")
  • prevent tied rows from favoring higher class labels in top2_accuracy / top3_accuracy
  • add regression coverage for direct helper use and metrics summaries with arbitrary prob_class_* labels

Tests

  • Not run as full repo tests here: this execution environment cannot clone GitHub or install the repository dependency set.
  • Locally checked the tie case in isolation: old ordering reported top-2 accuracy 2/3; patched stable ordering reports 1.0.

@github-actions

Copy link
Copy Markdown

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ ACTION actionlint 22 0 0 1.17s
✅ COPYPASTE jscpd yes no no 21.76s
✅ MARKDOWN markdownlint 101 0 0 0 2.5s
✅ PYTHON ruff 794 0 0 0 0.61s
✅ REPOSITORY git_diff yes no no 0.08s
✅ YAML prettier 62 0 0 0 2.44s
✅ YAML v8r 62 0 0 10.89s
✅ YAML yamllint 62 0 0 1.82s

Notices

📣 MegaLinter 9.5.0 is out! Discover the new features and security recommendations in the release announcement. (Skip this info by defining SECURITY_SUGGESTIONS: false)

See detailed reports in MegaLinter artifacts

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

@github-actions

Copy link
Copy Markdown

Test Results

     4 files  ±0       4 suites  ±0   4m 4s ⏱️ +2s
 3 050 tests +2   3 016 ✅ +2   34 💤 ±0  0 ❌ ±0 
12 200 runs  +8  12 064 ✅ +8  136 💤 ±0  0 ❌ ±0 

Results for commit 5b25a99. ± Comparison against base commit 869a643.

@FlorianPfaff FlorianPfaff enabled auto-merge (squash) June 28, 2026 21:43

Copy link
Copy Markdown
Member Author

The implementation is already present on main; I added the missing regression coverage in e9e4bb9, so closing this conflicted PR as superseded.

auto-merge was automatically disabled June 29, 2026 08:56

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant