Skip to content

Implement SmoothECE (kernel-smoothed calibration error) from Błasiok & Nakkiran 2023 #11

Description

@petteriTeikari

Background

Currently using vanilla binned ECE from torchmetrics.BinaryCalibrationError in src/stats/calibration_metrics.py (line 73).

The calibration curves use LOESS smoothing for visualization, but the ECE metric itself is standard binned ECE which has known issues:

  • Binning artifacts
  • Inconsistent with smooth visualization
  • Not principled for small sample sizes

Proposed Enhancement

Implement SmoothECE from:

Błasiok, Jarosław, and Preetum Nakkiran. 2023. "Smooth ECE: Principled Reliability Diagrams via Kernel Smoothing." arXiv:2309.12236.

Benefits

  1. Principled kernel smoothing instead of arbitrary binning
  2. Consistent with LOESS-smoothed calibration curves already used in figures
  3. Better behavior for small sample sizes (N=208 in our case)
  4. More interpretable reliability diagrams

Implementation Notes

  • Reference implementation available at https://github.com/apple/ml-calibration
  • Should integrate with existing src/stats/calibration_metrics.py
  • Consider adding as alternative metric alongside existing ECE for comparison

Related Files

  • src/stats/calibration_metrics.py - current ECE implementation
  • src/r/figures/fig_calibration_dca_combined.R - calibration visualization
  • docs/planning/dca-net-benefit-mini-review.md - mentioned but not implemented

Priority

Low - current LOESS visualization + Brier/IPA metrics are adequate for manuscript. This is a future enhancement for methodological rigor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions