API: Plotting
Optional helpers that require the plots extra
(pip install "fiducio[plots]"). Matplotlib is imported lazily.
reliability_diagram
reliability_diagram(probs: Any, targets: Any, mask: Any | None = None, ignore_index: int = -100, n_bins: int = 15, *, ax: Any | None = None, title: str | None = 'Reliability diagram', metric: str | None = 'ece', class_index: int | None = None) -> Any
Draw top-1 or class reliability and return the matplotlib Axes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
probs
|
Any
|
|
required |
targets
|
Any
|
|
required |
mask
|
Any | None
|
Optional voxel selection (see :class: |
None
|
ignore_index
|
Any | None
|
Optional voxel selection (see :class: |
None
|
n_bins
|
int
|
Number of confidence bins. |
15
|
ax
|
Any | None
|
Existing axes to draw on. A new figure/axes is created when |
None
|
title
|
str | None
|
Plot title ( |
'Reliability diagram'
|
metric
|
str | None
|
Which calibration error to annotate the panel with: |
'ece'
|
class_index
|
int | None
|
Optional class whose probability is compared with the observed class proportion (MHR for soft targets). The annotated ECE is against these targets, not the mean ECE against individual raters. See TwinTrack, Kirscher et al., MIDL 2026, https://arxiv.org/abs/2604.15950v2. |
None
|
Returns:
| Type | Description |
|---|---|
Axes
|
The axes the diagram was drawn on. |