WGO Deploy Bot Cursor commited on
Commit
f425603
·
1 Parent(s): e9c2cd9

Rename thresholded metric to f1_at_0_75; drop accuracy@0.5 from summaries.

Browse files
Files changed (2) hide show
  1. README.md +2 -2
  2. localization/score.py +5 -7
README.md CHANGED
@@ -80,9 +80,9 @@ No gold-aware snapping. Report **both** layers:
80
  | **Per event** | **IoU** | Overlap / union of one gold interval vs its matched prediction (within-label 1:1 assignment; unmatched → 0) |
81
  | **Run / split** | **mean IoU** | Mean of those per-event IoUs |
82
  | **Run / split** | **continuous F1** | Same number under this protocol: when the model returns the requested multiplicities, \(N_g = N_p\), so continuous F1 \(= 2S/(N_g+N_p)\) collapses to mean IoU. Emitted as `continuous_f1` (= `mean_iou`) for consistency with free-segmentation continuous F1 |
83
- | **Run / split** | **accuracy@0.5 / @0.75** | Fraction of gold events with IoU ≥ threshold |
84
 
85
- **Takeaway:** IoU is the event-level unit; continuous F1 is the run-level summary of those IoUs (not a different scoring rule). Always quote both names when reporting, and keep accuracy@0.75 as the strict headline next to them.
86
 
87
  Shipped code (this repo):
88
 
 
80
  | **Per event** | **IoU** | Overlap / union of one gold interval vs its matched prediction (within-label 1:1 assignment; unmatched → 0) |
81
  | **Run / split** | **mean IoU** | Mean of those per-event IoUs |
82
  | **Run / split** | **continuous F1** | Same number under this protocol: when the model returns the requested multiplicities, \(N_g = N_p\), so continuous F1 \(= 2S/(N_g+N_p)\) collapses to mean IoU. Emitted as `continuous_f1` (= `mean_iou`) for consistency with free-segmentation continuous F1 |
83
+ | **Run / split** | **F1@0.75** | Fraction of gold events with IoU ≥ 0.75. Under 1:1 binding with matched counts this equals thresholded precision = recall = F1 — the same F1@0.75 Macrodata uses for free segmentation (here without snap) |
84
 
85
+ **Takeaway:** IoU is the event-level unit; continuous F1 is the run-level summary of those IoUs. F1@0.75 is the Macrodata-aligned publish-style bar on the same bindings. Always quote continuous F1 and F1@0.75 together when reporting.
86
 
87
  Shipped code (this repo):
88
 
localization/score.py CHANGED
@@ -193,7 +193,6 @@ def score_episode(
193
  "pred_start_sec": None if pred is None else pred.start_sec,
194
  "pred_end_sec": None if pred is None else pred.end_sec,
195
  "iou": iou,
196
- "hit_0_5": iou >= 0.5,
197
  "hit_0_75": iou >= 0.75,
198
  }
199
  )
@@ -220,16 +219,16 @@ def metrics_from_rows(rows: Sequence[dict[str, Any]]) -> dict[str, Any]:
220
  - ``continuous_f1`` is the same number under this protocol (Ng = Np when
221
  the model returns the requested multiplicities): bound mean IoU ≡
222
  continuous F1 under one-to-one binding. Both keys are always emitted.
223
- - ``accuracy_0_5`` / ``accuracy_0_75``: fraction of gold events with
224
- IoU threshold.
 
225
  """
226
  if not rows:
227
  return {
228
  "events": 0,
229
  "mean_iou": None,
230
  "continuous_f1": None,
231
- "accuracy_0_5": None,
232
- "accuracy_0_75": None,
233
  }
234
  ious = [float(row["iou"]) for row in rows]
235
  mean_iou = sum(ious) / len(ious)
@@ -237,8 +236,7 @@ def metrics_from_rows(rows: Sequence[dict[str, Any]]) -> dict[str, Any]:
237
  "events": len(rows),
238
  "mean_iou": mean_iou,
239
  "continuous_f1": mean_iou,
240
- "accuracy_0_5": sum(iou >= 0.5 for iou in ious) / len(ious),
241
- "accuracy_0_75": sum(iou >= 0.75 for iou in ious) / len(ious),
242
  }
243
 
244
 
 
193
  "pred_start_sec": None if pred is None else pred.start_sec,
194
  "pred_end_sec": None if pred is None else pred.end_sec,
195
  "iou": iou,
 
196
  "hit_0_75": iou >= 0.75,
197
  }
198
  )
 
219
  - ``continuous_f1`` is the same number under this protocol (Ng = Np when
220
  the model returns the requested multiplicities): bound mean IoU ≡
221
  continuous F1 under one-to-one binding. Both keys are always emitted.
222
+ - ``f1_at_0_75``: fraction of gold events with IoU ≥ 0.75. Under 1:1
223
+ binding with Ng = Np this equals thresholded precision = recall = F1,
224
+ i.e. the same F1@0.75 Macrodata uses for free segmentation (no snap).
225
  """
226
  if not rows:
227
  return {
228
  "events": 0,
229
  "mean_iou": None,
230
  "continuous_f1": None,
231
+ "f1_at_0_75": None,
 
232
  }
233
  ious = [float(row["iou"]) for row in rows]
234
  mean_iou = sum(ious) / len(ious)
 
236
  "events": len(rows),
237
  "mean_iou": mean_iou,
238
  "continuous_f1": mean_iou,
239
+ "f1_at_0_75": sum(iou >= 0.75 for iou in ious) / len(ious),
 
240
  }
241
 
242