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') -> Any
Draw a top-1 reliability diagram 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'
|
Returns:
| Type | Description |
|---|---|
Axes
|
The axes the diagram was drawn on. |
Source code in src/fiducio/plots/__init__.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | |