AxelHolst commited on
Commit
3fad6c9
·
1 Parent(s): b980aaa

refactor(ui): use academic terminology for precision/recall metrics

Browse files
Files changed (1) hide show
  1. pages/Monitoring.py +6 -6
pages/Monitoring.py CHANGED
@@ -366,9 +366,9 @@ if not per_class.empty:
366
  with header_cols[1]:
367
  st.markdown("**Samples**")
368
  with header_cols[2]:
369
- st.markdown("**Recall**", help="Of all actual X buses, how many did we catch?")
370
  with header_cols[3]:
371
- st.markdown("**Precision**", help="When we predict X, how often are we right?")
372
 
373
  # Color-coded display for all 7 classes
374
  for _, row in per_class.iterrows():
@@ -388,7 +388,7 @@ if not per_class.empty:
388
  if actual_count > 0:
389
  st.markdown(f"{actual_count:,}")
390
  else:
391
- st.markdown("")
392
 
393
  with col3:
394
  if recall is not None and actual_count > 0:
@@ -404,11 +404,11 @@ if not per_class.empty:
404
 
405
  # Explanation
406
  st.caption("""
407
- **Recall**: Of all buses that were actually X, what % did we correctly predict as X? (catches crowded buses)
408
 
409
- **Precision**: Of all buses we predicted as X, what % were actually X? (avoids false alarms)
410
 
411
- Classes 4-6 are rare in Swedish transit data.
412
  """)
413
  else:
414
  st.info("No per-class metrics available.")
 
366
  with header_cols[1]:
367
  st.markdown("**Samples**")
368
  with header_cols[2]:
369
+ st.markdown("**Recall**", help="TP / (TP + FN) Sensitivity to this class")
370
  with header_cols[3]:
371
+ st.markdown("**Precision**", help="TP / (TP + FP) Positive predictive value")
372
 
373
  # Color-coded display for all 7 classes
374
  for _, row in per_class.iterrows():
 
388
  if actual_count > 0:
389
  st.markdown(f"{actual_count:,}")
390
  else:
391
+ st.markdown("*Not observed*")
392
 
393
  with col3:
394
  if recall is not None and actual_count > 0:
 
404
 
405
  # Explanation
406
  st.caption("""
407
+ **Recall** = TP / (TP + FN): Of all actual positives, what fraction did we correctly identify? High recall minimizes false negatives.
408
 
409
+ **Precision** = TP / (TP + FP): Of all predicted positives, what fraction were correct? High precision minimizes false positives.
410
 
411
+ Classes 4-6 (Crowded, Full, Not accepting) are rare in Swedish transit data.
412
  """)
413
  else:
414
  st.info("No per-class metrics available.")