Answer prose round 1: allow a bare :line in the history's format, date the shortened paths, say slots for top k, list the notes in --help, say no run could be scored, plainer item 85, 73 and 77 text, and the tools' path line

This commit is contained in:
2026-10-08 23:11:36 +02:00
parent a69cfd2624
commit 5cc37dd861
7 changed files with 25 additions and 22 deletions
+3 -3
View File
@@ -69,14 +69,14 @@ def auc(named: list[int], rest: list[int]) -> float:
def top_k(named: list[int], rest: list[int]) -> float:
"""The share of the metric's k highest units the seats named, k being how many they named. Units tied at the cut share its remaining seats evenly, as a random order of them would."""
"""The share of the metric's k highest units the seats named, k being how many they named. Units tied at the cut share its remaining slots evenly, as a random order of them would."""
k = len(named)
cut = sorted(named + rest, reverse=True)[k - 1]
above = sum(value > cut for value in named)
seats = k - above - sum(value > cut for value in rest)
slots = k - above - sum(value > cut for value in rest)
tied_named = sum(value == cut for value in named)
tied = tied_named + sum(value == cut for value in rest)
return (above + seats * tied_named / tied) / k
return (above + slots * tied_named / tied) / k
def medians(runs: list[RunScores]) -> dict[str, Score]: