Plots¶
All plotting functions return a Matplotlib figure. The Interpreter and the explanation objects
expose them as methods (interp.plot_report, expl.plot, ...).
Standard figures. Every function returns the matplotlib.figure.Figure it draws.
Conventions shared by all figures: a colour-blind-safe palette (Okabe-Ito), one fixed marker per series, the floor always grey and dashed, and titles/labels that say what is measured.
OKABE_ITO
module-attribute
¶
OKABE_ITO = [
"#0072B2",
"#E69F00",
"#009E73",
"#D55E00",
"#CC79A7",
"#56B4E9",
"#F0E442",
"#000000",
]
FLOOR
module-attribute
¶
plot_report
¶
plot_report(report: Report, readings=None)
One panel per reading, one line per representation, layers on the x axis. Readings that are undefined everywhere (e.g. the confusion agreement with fewer than 5 classes) are left out.
Source code in src\fannar\plots.py
plot_embedding
¶
The space of each layer projected on its two dominant modes (kernel PCA of G).
rows maps a row name to one GramSpace per layer. Colour = colors (predicted
class by default); x marks the model's errors when labels are known.
Source code in src\fannar\plots.py
plot_gram
¶
Component Grams, their Hadamard product and the final Gram, objects sorted by order_by.
Source code in src\fannar\plots.py
plot_spectrum
¶
Eigenvalues (fraction of the trace), cumulative energy, and the participation rank.
Source code in src\fannar\plots.py
plot_pair
¶
Top-k features of a pair: share per layer (heatmap) and the values in i and j.
Source code in src\fannar\plots.py
plot_errors
¶
Which features the model's errors hinge on, by true class (rows="class") or by
true→predicted confusion (rows="confusion").
- matrix: columns are the features (the
kwith the largest mean share over all errors), cells the mean share of the feature among the row's errors, with an arrow for the direction (↑: the errors have lower values than the nearest correct object of their true class; ↓: higher); - top: mean share over the errors against the mean share over correctly predicted objects (how much the feature matters to the model in general);
- right: errors per row, and the error rate of the class (or the fraction of all errors).
Source code in src\fannar\plots.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 | |
plot_energy_map
¶
Retained-energy map of one input, optionally over the image ((H, W[, 3]) in [0, 1]).