WorksComputer Science
Data, Numbers, and Geometry: Three Tutorials on Numerical Methods, Machine Learning, and Evaluation
Abstract
We present three practical tutorials on numerical computation and machine learning for mathematical research, developed for the DANGER: Data, Numbers, and Geometry workshop held at the Banff International Research Station in April 2026. The first develops a numerical approach to exterior calculus from pointwise evaluations of differential forms, using a flux formulation of the exterior derivative. Examples in Euclidean space and on the sphere illustrate geometric identities, topological features, and the effects of approximation and finite precision. The second examines how mathematical structure guides neural network design through examples involving elliptic curves, quivers, and a boundary value problem. It explores how architectural choices affect learning and uses interval arithmetic to bound the residual of a trained network over the full interval of the boundary value problem. The third addresses the evaluation and presentation of machine learning results, covering performance metrics, statistical uncertainty, classification thresholds, receiver operating characteristic curves, and accessible figure design. Throughout, the tutorials distinguish numerical agreement, predictive accuracy, structural guarantees, and rigorous bounds as different forms of evidence. Each contribution can be read independently, with accompanying notebooks and exercises that allow readers to reproduce the examples and adapt the methods to other problems.
Introduction
These notes bring together three technique tutorials from DANGER: Data, Numbers, and Geometry, held at the Banff International Research Station in April 2026. They offer a practical introduction to computing with mathematical data and using machine learning in mathematical research. Our emphasis is on the choices behind a calculation: how the data are represented, which structure a method uses, and how its results are assessed.
Tomás S. R. Silva begins with exterior calculus when a differential form is available only through pointwise evaluations. Expressing the exterior derivative through boundary fluxes leads to a numerical method. Examples in Euclidean space and on the sphere show how geometric identities and topological features can be explored from data, with attention to approximation errors and finite precision.
Yidi Qi examines how the structure of mathematical data guides the choice of a neural network. The examples involve elliptic curves, quivers, and a boundary value problem. They show how architectural choices affect learning and which properties can be built into a model. The final example uses interval arithmetic to bound the residual of a trained network over the full interval of the boundary value problem.
Jessica N. Howard discusses how to evaluate and present machine learning results. The tutorial moves from choosing performance metrics and estimating uncertainty to designing clear, accessible figures. Classification serves as a detailed example, showing how decision thresholds and receiver operating characteristic curves help assess a model’s performance.
Throughout the collection, numerical agreement, predictive accuracy, and rigorous bounds are treated as different kinds of evidence. Each tutorial can be read independently, with its own notation and references. We encourage readers to work through the accompanying notebooks and exercises, vary the examples, and try the methods on questions of their own.
Tutorial 1: A data-driven view of exterior calculus
Tomás S. R. Silva
Classical computational tools for differential forms assume symbolic expressions, mesh discretizations, or smoothness close to . In data-driven settings one often has only oracle access: the ability to evaluate a form at arbitrary points and tangent vectors, with no closed-form expression and no mesh. Building on a flux-based reformulation of the exterior derivative, recently developed by the author with D. Fadel and H. N. Sá Earp, in which the exterior derivative is recovered as a limit of normalized boundary integrals over shrinking blocks, we describe a mesh-free, symbol-free numerical scheme for exterior differentiation, valid under regularity assumptions weaker than . We demonstrate the method in , and on the sphere , verifying Stokes’ theorem, the identity , and Gauss–Bonnet purely from pointwise samples, and detecting de Rham cohomology (closed-but-not-exact forms) from data. Companion Jupyter notebooks accompany the paper. This article is based on a tutorial delivered at DANGER: Data, Numbers, and Geometry (Banff, April 2026).
Keywords: Exterior derivative; Stokes’ theorem; numerical exterior derivative; black-box methods; differential forms; de Rham cohomology.
Mathematics Subject Classification 2020: 26B05, 58A10, 65D25
Motivation: The Black-Box Perspective
Differential forms are the common language for flux through surfaces, circulation along curves, densities, and conservation laws; they organize electromagnetism, fluid vorticity, curvature in general relativity, and, increasingly, data analysis on manifolds. The unifying operation is the exterior derivative , which subsumes gradient, curl and divergence into a single operator satisfying and encoding topology through the obstructions to solving .
Textbook methods for computing with forms, however, assume too much. They require a symbolic formula for the form (often unavailable), a mesh or triangulation of the domain (expensive in high dimension), or smoothness close to (too restrictive). Discrete Exterior Calculus computes via cochains on a simplicial mesh [1], and Finite Element Exterior Calculus exploits the structure of a discrete de Rham complex [2]; both are powerful, and both presuppose a discretized domain. In practice – for instance when the form is produced by a trained neural network, a simulation, or a measurement process – we often have only pointwise samples: “We can evaluate for any point and tangent vectors , but we have no closed-form expression and no mesh.”
This paper takes that constraint as the starting point. Given only oracle access to :
Can we compute numerically?
Can we verify Stokes’ theorem from data?
Can we detect topology (e.g., closed but not exact) from data?
The answer to all three is yes, and the key insight is a geometric reading of the derivative, made rigorous in Ref. 3. Sections 2 and 3 summarize the theory and the resulting algorithm; Secs. 4 and 5 report numerical experiments in flat space and on the sphere, answering questions 1–3 in turn.
The Exterior Derivative as Infinitesimal Flux
Start in dimension one. If is differentiable at , then
where the interval is regarded as an oriented one-chain, so that . Read geometrically: the derivative is the infinitesimal flux of through the boundary of a shrinking ball, normalized by volume. This viewpoint, first proposed by Acker [4, 5, 6] and developed systematically in Ref. 3, generalizes verbatim to -forms in .
Definition 2.1 (Flux-based exterior derivative, Ref. 3, Def. 11). Let be a -form on an open set , flux-integrable around . We say is derivable at , with exterior derivative , if for every open set , every point , every choice of vectors , and every map with and for ,
where, for every fixed , the limit is taken over -blocks containing and shrinking to , with .
The aspect-ratio condition controls and is what makes the definition well posed; see Sec. 3 of Ref. 3. Crucially, derivability is strictly weaker than classical differentiability – need not even be continuous at for to exist. The main structural results are the following.
Theorem 2.1 (Ref. 3, Secs. 2–4). Let be open.
(i) (Mean value equality) If is a flux-continuous -form on a -block , derivable on , then there exists with .
(ii) (Stokes without ) If is continuous on and differentiable on for a singular -block , then whenever the right-hand side exists.
(iii) () Under natural integrability hypotheses, .
(iv) (Compatibility) If is differentiable at , then is derivable at and .
Item (i) is a genuine higher-dimensional Mean Value Theorem in equality form, obtained by iterating a Trisection Lemma on nested sub-blocks; item (ii) then follows by the same subdivision argument that derives the Fundamental Theorem of Calculus from the classical MVT, with the usual hypothesis on the integrand relaxed to exactly the FTC-type assumptions. For the present purposes the punchline is item (iv): Eq. (2.2) computes the classical whenever the latter exists. The flux formula is therefore a licensed numerical definition of the exterior derivative – and it consumes only pointwise evaluations of .
The Black-Box Algorithm and its Error Budget
Fix a point , a degree , and a step size . Discretizing Eq. (2.2) on the axis-aligned cube of side spanned by , and approximating each face integral by its midpoint value, yields the centered stencil [3]
for each increasing multi-index . The scheme is summarized in Algorithm 1; a reference implementation is available at
https://github.com/TomasSilva/NumericalExteriorDerivative
Algorithm 1 Numerical exterior derivative in (black-box)
Require: oracle sampler for a -form ; point ; step
Ensure: numerical components of
initialize the component array of to zero
for all multi-indices do
set equal to the right-hand side of Eq. (3.1), using oracle queries
end for
extend the increasing-index components to all indices by antisymmetry
return
Properties
No mesh is required – only pointwise evaluations. No symbolic expression is needed – the form is a pure black box. The underlying flux definition remains meaningful under regularity assumptions weaker than (Theorem 2.1). For oracle forms with locally coefficient functions, the centered stencil has truncation error .
The Fundamental Tension
In floating-point arithmetic the truncation error competes against catastrophic cancellation in the difference quotient. The total error is V-shaped in (Fig. 1), with sweet spot in double precision. When the oracle is noisy with amplitude – the relevant regime when is produced by a trained network or by measurements – the optimum shifts to : noisier oracles demand larger probe regions.
Experiments in Flat Space
In the single formula (3.1) specializes to the three classical operators of vector calculus: the probe region grows with the degree, and only the dimension of the boundary changes (Table 1). All that is needed is black-box evaluation of the form: a zero-form is an oracle , a one-form returns the component vector , a two-form returns the skew-symmetric matrix .
Exact and Non-closed Forms
For the algorithm returns to machine precision. For the non-closed form it recovers with error .

Figure 1. Truncation vs. cancellation for the centered stencil of Eq. (3.1). The optimum balances the two regimes; under oracle noise of amplitude it shifts to .
| 0-form | 1-form | 2-form | |
| output of d | 1-form | 2-form | 3-form |
| classical name | gradient | curl | divergence |
| probe region | segment | parallelogram | parallelepiped |
| boundary | 2 oriented points | 4 oriented edges | 6 oriented faces |
| boundary integral | |||
| says. . . |
Table 1. The unified picture in : one algorithm, three classical operators.
from Data
Starting from , we compute numerically (a one-form), then numerically (a two-form), chaining two applications of Algorithm 1. The result is : the identity is confirmed from data alone.
Topology from Data: The Vortex Form
Consider
The algorithm sees: at every test point away from the axis (the form is closed), and when the stencil straddles the singular axis. What the algorithm cannot see pointwise: there is no function with ; the form is not exact, and ; in particular, it equals for a positively oriented loop of winding number one. The method recovers this value by numerical line integration of oracle samples. The lesson: is local (checkable pointwise by Algorithm 1), while non-exactness is global – it requires integrating around loops. The gap between the two is de Rham cohomology, and it is detectable from data.
Stokes’ Theorem from Data
Take , the unit disk in the plane , the unit circle. Computing by applying Algorithm 1 at quadrature points and by direct oracle evaluation along the boundary gives
with both sides computed from black-box evaluations only – no formula for was used.
Experiments in Curved Manifolds: The Sphere
On three things change: the tangent space varies with ; stencil points leave the sphere; and a two-form is top degree (), hence a scalar density. The fix is minimal: replace the canonical basis by an orthonormal tangent frame at , and project stencil points radially back to the sphere, . Set and . For zero- and one-forms, respectively,
The factor is the tangent-vector scaling induced by the differential of the radial projection. The structural insight making this work is naturality. For the local parametrization , classical naturality gives , so the flat-space stencil applied to computes the intrinsic exterior derivative at . The corresponding naturality statement for on open Euclidean sets is Ref. 3, Lemma 13. For sufficiently smooth oracle data, this chart-based stencil retains convergence and the same scaling of the optimal step size.
Gradient of the Height Function
For the intrinsic gradient should point toward the north pole, have magnitude , and vanish at the poles. The algorithm recovers to the displayed six decimal places at the equator (1.000000), at 45°N (0.707107), near the pole (0.010000) and at the pole itself (0.000000), locating the critical points exactly.
Matches the Analytical Result
For the rotation form pulled back to , the analytical answer is . Over 200 random points the maximal error is ; the computed density is positive in the northern hemisphere, negative in the southern, and vanishes at the equator. The algorithm sees the geometry of the sphere – curvature, latitude – through black-box evaluations alone.
Stokes on Geodesic Caps
For the cap with boundary circle at height , both sides of equal exactly. The numerical verification is reported in Table 2: neither side used a formula for .
Gauss–Bonnet
Integrating the area form over the whole sphere by oracle sampling recovers . Since the unit sphere has , this area integral also equals the Gauss–Bonnet total-curvature integral , with . It is the total curvature , rather than the area itself, that is topologically invariant.
d2=0 on a Curved Manifold
Chaining two numerical derivatives on the sphere – , then , then – yields at every test point. The error is larger than in because two numerical derivatives are chained, each using projected stencil points. In exact arithmetic it converges to zero as ; in finite precision, convergence persists only down to the optimal step size, after which cancellation dominates. The identity is universal, and verifiable from black-box evaluations alone.
Summary
Pointwise evaluation of differential forms is sufficient to recover their exterior derivatives, verify Stokes’ theorem, and detect topological features – on flat spaces and curved manifolds alike.
Outlook: Learning Geometry from Data
The natural habitat of the black-box scheme is the growing interface between machine learning and differential geometry, where forms are increasingly learned rather than written down. In Ref. 7, neural networks learn a Ricci-flat metric on a Calabi–Yau threefold and approximate the -structure three-form on the associated seven-dimensional link in ; the numerical exterior derivative described here serves as the validation layer, certifying (co)closure conditions of the learned forms without symbolic access to them. In that regime the noisy-oracle analysis of Sec. 3.2 () is the operative one.
Natural next steps include systematic exterior calculus on learned implicit manifolds, estimation of de Rham cohomology from sampled forms via the local-to-global gap exhibited by the vortex example, and higher-degree stencils in the ambient dimensions relevant to special holonomy. The three tutorial notebooks (block1_1d_story.ipynb, block2_R3_forms.ipynb, block3_S2_forms.ipynb), covering every experiment reported above with guided exercises, are available at https://github.com/TomasSilva/Banff-Tutorial, alongside the SageMath [8] reference implementation.
Acknowledgments
The author thanks Daniel Fadel and Henrique N. Sá Earp, co-authors of the survey [3] underlying this tutorial, and the DANGER organizers – Edward Hirst, Elli Heyes, Miranda Cheng and Sergei Gukov – for the invitation and for assembling such a stimulating meeting. The ideas revisited here originate with Felipe Acker [4, 5, 6]. The author was supported by the São Paulo Research Foundation (FAPESP), grant 2022/09891-4.
ORCID
Tomás S. R. Silva – https://orcid.org/0000-0002-5825-9133
Tutorial 2: Architectures for mathematical data
Yidi Qi
Mathematical objects rarely arrive as unstructured feature vectors. They arrive as sequences indexed by primes, as directed graphs closed under a combinatorial move, as functions constrained by a differential equation. Choosing a neural architecture is therefore not a matter of choosing the largest model, but of choosing an inductive bias that matches the structure the data already has. We develop this principle through three self-contained case studies, each implemented from scratch in JAX and each runnable on a laptop CPU. (i) Sequential data: a 1D CNN and a single-block transformer predict the rank of an elliptic curve from its normalized Frobenius traces ; a saliency analysis tracked across training shows the network localizing the discriminative signal in the small primes, where the murmuration phenomenon lives. (ii) Graph data: a directed graph isomorphism network classifies quivers by Dynkin mutation type, is permutation equivariant to machine zero by construction, and—trained only on 7 and 8 vertices—transfers to quivers on 9 vertices. (iii) Continuous data: a physics-informed neural network solves a two-point boundary value problem, after which interval arithmetic bounds the residual rigorously over the entire domain rather than at the collocation points. Companion Jupyter notebooks can be viewed at https://github.com/yidiq7/Banff-Tutorial-Architecture. Based on a tutorial delivered at DANGER: Data, Numbers, and Geometry (Banff, April 2026).
Tutorial 2: Architectures for mathematical data
Introduction: Inductive biases of the architectures
Machine learning enters mathematics along two broadly distinct routes. In the first, the model is a reasoning engine: language models and agents that prove theorems, generate conjectures, or search proof spaces. In the second, mathematical objects are treated as structured data—invariants, sequences, graphs, functions—and the task is to learn a map from that data to a quantity of interest, sometimes as a route to human insight. [1, 2] This tutorial is about the second route, and about one question inside it: given the data, which architecture?
The question has content because architectures are not interchangeable function approximators. Each carries an inductive bias: structural assumptions baked into the hypothesis class before training. A convolution assumes the same local pattern is meaningful wherever it occurs; a message-passing layer assumes the answer does not depend on how the vertices are numbered; a physics-informed loss assumes the target satisfies a differential equation. When the assumption matches the mathematics it buys sample efficiency, generalization and—as in Sec. 3—exact structural guarantees no amount of training data can supply. Table 1 is the map used to organize the tutorial.
We develop three of the rows further below against genuine mathematical problems and datasets: sequential (Sec. 2), predicting the rank of an elliptic curve over from its Frobenius traces; graph (Sec. 3), classifying quivers by Dynkin mutation type; and continuous (Sec. 4), solving a boundary value problem with a PINN and then verifying the result rigorously.
| Data type | Key structure | Architecture(s) | Inductive bias |
| Tabular | unstructured features | MLP, boosted trees | smoothness; axis-aligned splits |
| Sequential | order, locality | 1D CNN, transformer, SSM | shift equivariance; attention; recurrence |
| Grid / image | 2D spatial structure | 2D CNN, ViT, U-Net | 2D translation equivariance, locality |
| Set / multiset | no ordering | DeepSets, set transformer | permutation-invariant aggregation |
| Graph | nodes, edges, topology | GNN (message passing) | permutation equivariance, locality |
| Geometric | symmetry group () | equivariant networks | group equivariance by construction |
| Continuous / PDE | smoothness, differential equations | PINN, FNO, Deep-ONet | PDE constraints; operator learning |
Table 1 (PDF p. 10). The landscape: from the structure of the data to the architecture that encodes it.
Sequential Data: Elliptic Curve Rank from Frobenius Traces
The data and the task
For an elliptic curve of conductor and a prime , the Frobenius trace is , and the Hasse bound makes
a natural normalization. [3] Collectively the determine , whose order of vanishing at is the analytic rank; Birch–Swinnerton-Dyer predicts this equals the rank of . Our dataset consists of 17,340 curves of conductor (9,323 of rank 0, 8,017 of rank 1), each represented by the vector of 1,229 normalized traces at all primes . The task is binary classification of the analytic rank, 0 versus 1, on an 80/20 split (13,872 train, 3,468 test), with per-position standardization fitted on the training set only.
What makes this sequential rather than tabular is the murmuration phenomenon: averaging over all curves of a fixed rank in a fixed conductor range and plotting against produces an oscillation whose phase and sign depend on the rank. [4, 5] In the conductor range used here it shows up as a large excursion of the two class averages, opposite in sign and concentrated at small (Fig. 1(a),(b)), which is invisible in any single curve (Fig. 1(c)). The discriminative structure is therefore a pattern along the prime axis—exactly what a locality-respecting architecture is built to detect.
Two architectures, one parameter budget
A 1D convolution slides a kernel of width along the sequence,
Figure 1 (PDF p. 11). (a) Class-averaged Frobenius traces over the training split. (b) The same after Hasse normalization, . In both, the two class averages are near mirror images and their separation is largest at small . (c) Two individual curves over the first 100 primes: the per-curve signal is indistinguishable from noise, so the pattern is a property of the sequence, recoverable only in aggregate.
so a pattern detected at one position produces the same response elsewhere. [6] This is translation equivariance along the prime index; with pooling, a few kernels can look for local oscillations at every scale. Our CNN is , flattened to and classified by a two-layer head.
The control is an MLP of shape , which sees the input as a flat vector in : every prime position gets dedicated weights and the ordering of the primes is, to the model, arbitrary. The two models are sized to essentially the same parameter count (39,714 versus 39,922), so the comparison is about inductive bias rather than capacity, and both are trained identically: Adam, learning rate , batch size 512, ten epochs.
Table 2: Rank classification on 3,468 held-out curves. The CNN and MLP have matched parameter budgets and see all 1,229 primes; the transformer sees only the first 100 (), where attention’s cost is affordable, so its accuracy is not directly comparable to the other two.
| Model | Input | Parameters | Train acc. | Test acc. |
| 1D CNN | 1,229 primes | 39,714 | 99.91% | 99.88% |
| MLP | 1,229 primes | 39,922 | 100.00% | 99.13% |
| Transformer | 100 primes | 11,746 | 99.53% | 99.51% |
Table 2 (PDF p. 11). Rank classification on 3,468 held-out curves.
Table 2 reports the outcome. Both models solve the task, which is worth stating: the rank is recoverable from data to nearly 100% accuracy, consistent with earlier data-scientific studies of BSD. [4, 7] The instructive difference is the generalization gap. The MLP memorizes the training set exactly (100.00%) and returns 99.13% on held-out curves, a gap of 0.87 points; the CNN, at the same parameter count, closes it to 0.03 points (99.91% versus 99.88%). Weight sharing along the prime axis removes degrees of freedom the data does not need—and what it removes is what the MLP spends on memorization.
| surface integral | line integral | ||
| 0.0 | 6.2831853 | 6.2831853 | |
| 0.5 | 4.7123890 | 4.7123890 | |
| 0.9 | 1.1938052 | 1.1938052 |
Table 2. Stokes’ theorem on geodesic caps , verified from black-box evaluations only. Exact value: .
One caveat keeps this honest: the task is nearly saturated, so the comparison discriminates between 99.1% and 99.9% rather than between success and failure. A harder version—higher ranks, larger conductors, fewer primes—would separate the two architectures more sharply, and the gap reported here should be read as an indication of direction rather than of magnitude.
What the network learned: saliency across training
A classifier that is right for the wrong reason is not evidence about mathematics. Following the standard construction, [8] define the per-class saliency at prime as the average sensitivity of the logit for class to the input coordinate ,
the average running over the held-out curves the network assigns to class ; in JAX this is one call to jax.grad composed with jax.vmap. Figure 2 plots the rescaled map , so only the shape matters. Evaluating Eq. (2.3) at every epoch checkpoint turns interpretability into a movie rather than a snapshot.
Figure 2. Rescaled per-class saliency of the 1D CNN at three training checkpoints. At epoch 1 the map is unstructured noise. By epoch 4 it has become smooth and antisymmetric between the two classes, with oscillatory structure below . By epoch 7 the sensitivity is sharply concentrated in the small primes and decays towards zero for large : the network has localized the discriminative signal in exactly the regime where the class averages of Fig. 1 separate.
Three features are worth naming. The saliency is antisymmetric between classes, , the correct signature for a binary discriminant built on a signed statistic. It becomes smooth in , the fingerprint of weight sharing and not something an MLP produces. And it concentrates: mass migrates over training towards , the regime where the class averages of Fig. 1(b) separate most cleanly. The direction of inference matters: this shows the CNN weighting the region where the known murmuration signal is strongest, not the CNN independently discovering murmurations.
Attention as a different bias
Self-attention makes no locality assumption: every position may attend to every other, and ordering enters only through an explicit positional encoding. [9] The price is the cost of the attention matrix, so we restrict to the first primes () and build one encoder block from scratch—input projection, sinusoidal positional encoding, two-head scaled dot-product attention with residual connection and layer normalization, position-wise feedforward, mean pooling, linear classifier. With 11,746 parameters it reaches 99.51% (Table 2).
This is not a like-for-like comparison with the CNN, which sees all 1,229 primes, and we do not read it as one: the point is that a bias making no locality assumption at all still recovers the rank from a twelfth of the input. Attention is the more flexible bias and it is not free—quadratic cost is what forced the truncation in the first place. It earns that cost when the relevant interactions are long range, and deciding whether they are is a question about the mathematics, not the model.
Graph Data: Quivers and Mutation Classes
Quivers, mutation, and the task
A quiver is a directed multigraph, encoded here by a skew-symmetric exchange matrix with recording arrows . The mutation at a vertex acts by [10]
which combinatorially means: complete every 2-path by a new arrow , reverse all arrows at , then cancel any 2-cycles created. Mutation generates an equivalence relation, and the mutation class of a Dynkin quiver is a basic invariant in the theory of cluster algebras.
We take the families (the path ) and (a path with a fork at ), apply between 5 and 25 random mutations to each seed, deduplicate the resulting exchange matrices, and ask the model to recover the type. After a handful of mutations the quivers carry cycles, multiple arrows and reversed orientations and no longer resemble their Dynkin diagrams, so this is not pattern matching. The construction follows the setting of Ref. 11, which studies mutation-class classification with GNNs at larger scale and with explainability methods. We train on 800 quivers with vertices and test on 100 quivers with —a size never seen during training.
DirGINE: three design decisions
A message-passing layer updates each vertex from its neighbours, , which in matrix form is a single product . [12] Three choices turn this skeleton into an architecture suited to quivers.
Sum, not mean. Mean aggregation is not injective on multisets: distinct neighbourhoods collapse to the same output. The Graph Isomorphism Network replaces it by a raw sum followed by an MLP,
which is provably as expressive as the 1-Weisfeiler–Leman test. [13]
Direction matters. Mutation reverses arrows, so two quivers with the same underlying undirected graph but different orientations may lie in different mutation classes; an orientation-blind model discards exactly the information the task turns on. Following Ref. 14, we split aggregation into an incoming and an outgoing channel,
with , two-layer MLPs. In code this is A_in @ MLP_in(H) + A_out @ MLP_out(H): still just matrix multiplication. The resulting DirGINE [11] uses four layers of width 32, a sum readout and a linear classifier (17,696 parameters), and starts from constant vertex features—all the information is in the topology.
Locality is size-agnostic. Nothing in Eq. (12) refers to the number of vertices, so the same weights apply to graphs of any size.
Equivariance for free, and generalization across size
Because Eq. (12) is built only from adjacency products and position-wise maps, permutation equivariance is structural rather than learned: for any permutation matrix ,
and the graph-level logits, obtained by a sum readout, are exactly invariant. The identity holds in exact arithmetic for any weights; measured numerically on a test quiver it holds to the last bit, both errors coming out at 0.0 rather than at the one would accept from an approximately equivariant model. This is the sharpest illustration in the tutorial of what an inductive bias is: a property holding for every input, before training, with no data required. A model without it would have to learn Eq. (13) from examples, and would only ever hold it approximately.
Table 3: Quiver mutation-type classification (type versus type ), after eleven epochs. The model is trained on 800 quivers with and evaluated on 100 quivers with , a size never seen in training. Independently of training, the node equivariance of Eq. (13) and the invariance of the graph-level logits both hold with maximum error exactly 0.0.
| Evaluation set | Vertices | Accuracy |
| Training set | 7, 8 (seen) | 100% |
| Test set | 9 (unseen) | 99% |
Table 3.
Table 3 records the payoff. Trained only on 7 and 8 vertices, the network reaches 99% on quivers with 9—a direct consequence of locality: message passing learns a rule about neighbourhoods, and neighbourhoods do not know how large the ambient graph is. Whether the transfer degrades gracefully at substantially larger , and whether a fixed depth of four layers eventually becomes the binding constraint as the diameter grows, is the natural next experiment.
Continuous Data: PINNs and Rigorous Verification
The problem and the network
The third inductive bias constrains the model by a differential equation rather than a symmetry. Consider the two-point boundary value problem
whose exact solution is . A physics-informed neural network [15] replaces the discretization of Eq. (4.1) by a network trained to make the residual small,
The derivative is not a finite difference but the exact derivative of the network, obtained by composing jax.grad with itself, so Eq. (4.2) carries no discretization error at the collocation points. We take to be a tanh network of shape (97 parameters), collocation points uniformly spaced in , , and Adam steps at learning rate . The network is deliberately shallow: the over-approximation (“wrapping”) incurred by the interval analysis of Sec. 4.2 compounds with depth, so verifiability is itself an architectural constraint.
Training converges to , and agrees with to a maximum pointwise deviation of on a fine grid (Fig. 3(a),(b)). This is where most PINN demonstrations stop—and, for a problem whose exact solution is unknown, where the honest questions begin. The residual was checked at 50 points. What happens on the rest of the continuum?
Interval arithmetic: from a good fit to a proof
An interval denotes , and interval arithmetic propagates guaranteed enclosures through computation: [16, 17]
Two points make the guarantee real rather than nominal. First, even is not computed exactly—IEEE 754 rounds to the nearest representable double [18]—so every lower bound is nudged down and every upper bound up by one unit in the last place (np.nextafter), and a length- inner product is widened by ULPs. Second, interval arithmetic ignores correlations between operands: over returns , not . Enclosures are thus always valid and generally pessimistic, and controlling that pessimism is the engineering problem.
To bound over a whole subinterval we propagate the jet through the network in interval form—forward-mode automatic differentiation by hand, every intermediate quantity an enclosure. A linear layer gives , ; for , writing ,
Each operation in Eq. (17) admits a rigorous enclosure: is monotone, so its enclosure is exact up to rounding; squaring is tightened by hand when the interval straddles zero; is enclosed by its endpoint values, corrected at any critical point inside the interval. The full scheme is Algorithm 1, closely related to interval bound propagation as used for neural network verification. [19]
What verification reveals
Running Algorithm 1 with certifies
a statement about every point of the domain rather than about a finite sample. The enclosure is not loose: Fig. 3(c) shows it hugging the pointwise residual evaluated at subinterval centres, so at the wrapping effect has not yet swamped the estimate.
Two things follow. The first is a matter of magnitude. The converged loss is dominated by its residual term, so the residual at the 50 collocation points has root-mean-square about ; the guaranteed worst case over the continuum, Eq. (18), is four times larger. A Algorithm 1 Rigorous residual bound for a trained PINN
Require: trained parameters ; domain ; subdivision count
Ensure: with for every
partition into intervals of width
for each (vectorized over ) do
initialize the jet
for each layer do
propagate by Eq. (17) in interval arithmetic with outward rounding
end for
end for
return
Figure 3. (a) The trained PINN against the exact solution . (b) Training loss. (c) The interval enclosure of the residual over subintervals (band) against the pointwise residual at subinterval centres (line). The enclosure is tight; the residual oscillates within about across the interior and rises steeply at both endpoints.
training curve that has flattened at is reporting an average over the points it was given, and averages over samples are not bounds.
The second is a matter of shape. The residual is far from uniform (Fig. 3(c)): it oscillates between about across the interior, through five local extrema, and then rises steeply within the outermost few per cent at each end, attaining its maximum at and . A sufficiently dense pointwise scan would suggest the same picture; what the interval computation adds is the guarantee that the bound holds between the sample points too, so the maximum cannot be hiding in a gap the scan stepped over. This is the practical argument for verification over validation: sampling tells you about the samples.
Every quantity entering Eq. (18) is an interval computation with outward rounding. Granted that the library’s and are accurate to within the one unit in the last place by which each enclosure is widened, the inequality is therefore a statement about the trained network rather than a statistic—and, unlike the deviation of Sec. 4.1, it is obtained without any knowledge of the exact solution. Converting a residual bound of this kind into a bound on , and sharpening the constants involved, is a subject in its own right. [20]
Discussion
Three data types, three inductive biases, three kinds of payoff. For the sequential data of Sec. 2, matching architecture to structure bought generalization: at identical parameter budget, weight sharing cut the train–test gap from 0.87 points to 0.03, and saliency confirmed the network weighting the primes where the murmuration signal lives. For the graph data of Sec. 3, it bought an exact guarantee: permutation equivariance held to machine zero before a single gradient step, and locality carried a model trained on 7 and 8 vertices to 99% on 9. For the continuous data of Sec. 4, it bought verifiability: because the model is a small smooth function of one variable rather than a lookup table, interval arithmetic bounded its residual at every point of the domain—and that guaranteed bound turned out to be four times the residual the training loss was reporting.
These are not three tricks but one habit. Before choosing a model, ask what the data is invariant under, what it is indexed by, and what equations it satisfies; then pick the architecture that already respects those answers. In mathematics the answers are unusually well specified—the symmetry group, the differential equation, the irrelevance of vertex labels—and that specificity is an advantage the field should spend rather than ignore.
Several directions follow. The rank task should be pushed where architecture separates models more sharply: higher ranks, larger conductors, or restriction to the small primes where the signal concentrates. For the mutation classifier, the obvious tests are more Dynkin types, larger quivers, and explainability methods in the spirit of Ref. 11. The verification pipeline of Sec. 4 has the broadest reach: rigorous a posteriori certification of learned objects—solutions of differential equations, but equally metrics, forms and other geometric data produced by networks—is where machine learning and mathematics can meet without either giving up its standards of proof.
The three tutorial notebooks (block1_sequential.ipynb, block2_graph.ipynb, block3_pinn.ipynb), together with the elliptic curve dataset and Colab links, are available at https://github.com/yidiq7/Banff-Tutorial-Architecture. Each is self-contained, depends only on JAX, NumPy and Matplotlib, and runs on CPU in minutes.
Acknowledgments
The author thanks the DANGER organizers—Edward Hirst, Elli Heyes, Miranda Cheng and Sergei Gukov—for the invitation and for assembling such a stimulating meeting, and the tutorial participants for questions that sharpened several of the points above.
ORCID
Yidi Qi – https://orcid.org/0000-0002-2094-0257
Tutorial 3: Tips and tricks for analyzing and presenting machine learning results
Jessica N. Howard
These lecture notes summarize the main points from the third tutorial session of the workshop “DANGER: Data, Numbers, and Geometry” held in April 2026 at the Banff International Research Station for Mathematical Innovation and Discovery (BIRS). The accompanying code and slide presentation can be found at jnhoward/Banff-Tutorial/.
Tutorial 3: Tips and tricks for analyzing and presenting machine learning results
Introduction
At its core, Machine Learning (ML) is an incredibly powerful tool because of its ability to extract high-dimensional, non-linear relationships between features in data.1 But the high dimensionality and probabilistic nature of data pose two key challenges:
High Low: Ultimately, we need to compress our machine-learned relationships into much lower dimensional spaces. This is partly because we can only really think intuitively in low dimensions (2, 3, maybe 4), making this dimensionality reduction useful for interpretation. More pragmatically, we also have to represent these machine-learned relationships in two-dimensional plots that we can use in papers. Therefore, we typically rely on summary metrics to understand our high-dimensional, machine-learned results.
Uncertainties and generalizability: If an ML model trains on certain random samples of data, will the learned relationships still work on new random samples? What are the statistical uncertainties we can expect on the summary metrics?
The goal of these notes is to provide a brief survey of common techniques and best practices to approach these challenges. The target audience are individuals who are just getting started with ML. Thus, we limit our scope to introductory concepts, but will include references where one can learn more. The reader should be familiar with basic ML terminology such as loss function and training/validation/testing data split.
Summary Metrics for Common ML Tasks
A trained ML model typically defines a high-dimensional relationship that cannot be inspected directly. Summary metrics are low-dimensional representations of model performance. Note that the loss function used to train your ML model is one such low-dimensional representation. However, it is generally advantageous to look at other metrics in addition to the loss function to fully assess performance.
The appropriate metric(s) depends strongly on the type of ML task. We can generally split ML tasks into three categories: (1) Generative modeling, (2) Regression, (3) Classification. We will briefly cover common summary metrics for (1) and (2) and then do a much deeper dive on (3) in Section 3 since it is the most theoretically well-understood case.
Generative Modeling Task
For a generative modeling task, the objective is to learn a model distribution that approximates the target distribution . For example, a model that generates images of cats is implicitly learning the distribution of all possible cat images. Evaluating such a model therefore requires a summary metric that quantifies the difference between the model and target distributions.
It turns out there are not many ways to robustly compare two high-dimensional probability distributions. One can use distance metrics such as Maximum Mean Discrepancy (MMD) [3], which is an integral probability metric that measures the largest difference between expectations over kernel functions within a chosen class, or Optimal Transport distances [4], which quantify the cost of transforming into . Another approach is to train a classifier to distinguish model-generated samples from target samples [5]. This works because an optimal classifier is closely related to the likelihood ratio between the two distributions. If the distributions have overlapping support and their probability densities can be estimated, one may also use -divergences such as the Kullback-Leibler (KL) divergence [6]. However, reliable density estimation may require many samples, particularly in high dimensions.
Given the limited number of options, it is common for one of these metrics to already appear in the model’s training loss. Thus, ideally, model performance should be evaluated using another metric as well.
Regression Task
For a regression task, the objective is to learn a function, , that approximates the target function, , across the domain of . For continuous outputs, such as predicting the age of a cat from an image, a common summary metric is the Mean Squared Error (MSE),
which measures the average squared difference between the predicted and target values. When the target values have known uncertainties, , these differences can instead be weighted to calculate the chi-squared statistic,
If every , this becomes the residual sum of squares.
Categorical outputs, such as the eye color of the cat in the image, can be represented numerically using one-hot encoding and compared using similar metrics (e.g. MSE). Namely, given an image, , say the true color of the cat’s eyes is “Teal”. We can turn this label into a continuous vector,
where is the number of categories, which in this case is the number of possible cat eye colors. In practice, however, categorical labels are usually best treated in a multi-class classification setup.
Regression vs Classification
When the task is categorical in nature, regression and classification become very similar. And in fact, one could learn to classify data by regressing the encoded class label vectors. In this case, the model would output a continuous vector which is then matched to the appropriate unit target vector via an MSE loss.
On the other hand, a classification model’s output is typically interpreted as a categorical distribution across the model classes. In this case, it is advantageous to change our loss function to categorical cross-entropy (i.e. cross entropy evaluated on these categorical distributions).2 For example, when trying to match the correct label vector a regression algorithm may predict while a classification algorithm may predict which is appropriately normalized. Of course, one could also use MSE on this normalized vector, but cross-entropy turns out to work better in practice. Using MSE to train a classifier in this case will result in slower convergence during training due to vanishing gradients [6, 7, 8].
Binary Classification Analysis: From Scores to ROC Curves
Our task will be to assign one of two labels to each data point . We will call the two classes A and B. Let be a binary classifier which assigns an example data point, , a one-dimensional score, . Note that this score need not be a strict probability [9]. However, we will interpret higher (lower) scores as indicating that belongs to class B (class A). But how large is large enough to be considered as belonging to class B? Ultimately, we need to turn this continuous score into a binary decision about the identity of . We can do this by imposing a threshold defining what is “B enough”. Changing this threshold will produce different labels for the same . The goal is to optimize this choice so that the predicted labels are as close as possible to the true ones.
Score Thresholds and the Confusion Matrix
After choosing a threshold, the data points, , with scores, , above the threshold, , are classified as B (“accepted”), while those below it are classified as A (“rejected”). The True Positive Rate (TPR) is the fraction of actual B data points above the threshold, and the False Negative Rate (FNR) is the fraction of actual B data points below it, so that TPR + FNR = 1. Similarly, the False Positive Rate (FPR) is the fraction of actual A data points above the threshold, while the True Negative Rate (TNR) is the fraction below it, with FPR + TNR = 1. This naming comes from medical fields where the goal is usually to test for a particular disease. Thus, the two classes are “Positive” and “Negative” instead of B and A.
These four quantities can be used to form the confusion matrix,
where () is the number of B (A) data points in the sample. The confusion matrix summarizes the classifier’s behavior at a particular threshold. Several named metrics can be derived from this such as accuracy and F1-score .
In high-energy particle physics terminology, the classes are = signal and = background. Thus, the TPR is also called the signal efficiency, , since it is the amount of signal accepted. Similarly, the FPR is the background efficiency, , and the TNR is the background rejection rate, .
The Receiver Operating Characteristic (ROC) Curve

Figure 1 (PDF p. 23). Figure showing how a ROC curve can be constructed from a score distribution. Various threshold values are swept from right to left. For each threshold the TPR (fraction of class B scores falling above the threshold) and TNR (fraction of class A scores falling below the threshold) are measured. These (TPR, TNR) points are collected to form the ROC curve. The points on the ROC curve corresponding to the three thresholds are indicated.
Varying the score threshold changes the tradeoff between TPR and TNR. Consider the example in Fig. 1 which shows three possible thresholds. Threshold 1 rejects all data points, giving (TPR, TNR) = (0, 1). At the opposite extreme, threshold 3 accepts all data points, giving (TPR, TNR) = (1, 0). Threshold 2 provides a more useful compromise, accepting 0.31 of the B data points while rejecting 0.946 of the A data points. Continuously moving the threshold from right to left traces out the receiver operating characteristic (ROC) curve, which summarizes the available tradeoffs between signal acceptance and background rejection.
A common single-number summary of the ROC curve is the area under the curve (AUC). An ideal classifier has AUC = 1, while random guessing gives an AUC = 0.5. While useful, the AUC can have some drawbacks since it is compressing the entire ROC curve into a single number. Importantly, it does not indicate which threshold should be used. Two classifiers might have the same AUC but one may be more performant for a particular threshold of interest (for example very high TNR). Ideally, one can compare ROC curves directly, however when testing many models at once this can quickly become cumbersome. So AUC is used as a standard proxy for performance, however it can be useful to look at additional ROC-derived metrics.
Conventions and Alternate Visualizations
Typically, you will see ROC curves displayed as either FPR on the horizontal axis and TPR on the vertical axis or TPR on the horizontal axis and TNR on the vertical axis. The latter is particularly common in experimental high-energy particle physics. However, the majority of state-of-the-art ML papers tend to plot an alternate ROC curve: TPR on the horizontal axis and on the vertical axis. This alternative display is particularly useful when comparing classifiers which have started to saturate performance (AUC ) since it will accentuate small, yet significant, differences.
Extending to Multiple Classes
Multi-class classification extends binary classification to problems with more than two possible category labels. The primary change occurs in the loss function where we now use categorical cross-entropy [6],
where is the number of classes, is the true label (i.e. 1 or 0), and is the predicted probability for class . For example, say we have . For a data point we have , meaning it belongs to class 1. And say our classifier predicts . Then the categorical cross-entropy is . When categorical cross-entropy simply reduces to the binary case. For visualizing the results, performance is often analyzed through pairwise comparisons. For each matchup we can then construct ROC curves as in the binary case.
Statistical Uncertainties and Dealing with Limited Data
The metrics that we calculate inherit randomness from the data we use to calculate them. So we can ask questions like, “how likely was it that we got a particular AUC value?” and “what happens if we used a larger data sample?”. In other words, what are the statistical properties of our metrics?
Metrics as Random Variables
Any performance metric will be estimated from a finite test set, . Since is a random variable, will be as well. Thus, a different sample, , drawn from the same underlying distribution will generally produce a different value of . This means the estimate will have a statistical uncertainty coming from the randomness in .
We can imagine calculating for many different samples and forming a histogram of the values. From this we can then ask about the statistical properties of the distribution of values. For example, what is the average and standard deviation of this distribution? How likely is a particular value? Ultimately, this will help us infer what the true value of is most likely to be.
This process is best illustrated via a classic example from statistics: estimating the standard error on the mean. In this case, our metric is the true mean, , of a distribution, . From a random sample , we can get an estimate of the mean as . We can repeat this for different to get a distribution of values. Alternatively, we could think of this as sampling some distribution . For sufficiently large we know that will be approximately normally distributed for any well-behaved by the Central Limit Theorem (CLT). Let () be the true mean (variance) of . Then the original mean of can be estimated as . Here, is known as the standard error on the mean. The same procedure works for other metrics. In general, let be the true mean and variance of the distribution of estimates, , of a metric . Then we say that .
We can estimate , in practice by constructing an empirical estimate of . When sufficient independent data are available, , can be estimated by dividing the data into independent test sets, , each containing data points, and evaluating the metric on each set. The resulting ensemble can then be used to estimate both the expected metric value and its variance,
such that now .
This procedure is preferable when feasible, but it requires a total of independent samples. In practice, one typically would like at least and . The latter is a familiar rule-of-thumb for when will be approximately Gaussian by the CLT, however it depends heavily on the test statistic and assumes that the distribution is reasonably well-behaved. Practically, will usually be far larger. And, in general, the larger and are, the better since substantially larger test sets provide more reliable estimates of and . Concretely, in ML applications one can expect and . In cases where there is a limited amount of independent data, one must employ resampling methods to construct .
Resampling Methods
When independent test data are limited, resampling methods provide an alternative way to construct an ensemble of test sets from a single sample . Note that these methods still assume that is sufficiently large for the empirical distribution of to approximate the underlying distribution reasonably well. Moreover, must contain held-out test data only; none of its observations should have been used to train the model or select its architecture and hyperparameters during validation. Two common resampling methods are the bootstrap and the jackknife [10].
In bootstrap resampling, each new test set is constructed by drawing observations from with replacement. Consequently, some observations may appear multiple times in a bootstrap sample, while others may not appear at all. The metric is evaluated on these bootstrapped samples, and the resulting values are used to estimate and .
In Jackknife resampling, we instead construct test sets of size . Each set is formed by leaving out a different observation from , so that every observation is omitted exactly once. For example . Therefore, we evaluate the metric on sets of samples. The Jackknife estimates are then
where is the metric evaluated on all samples (i.e. ) and is the Jackknife estimated bias. Then, and [10].
The exercise in Section 6.2 compares both of these resampling methods to the method of splitting the test data into independent sets. For details on the tradeoff between bootstrap and jackknife resampling see Refs. [10, 11].
Plot Design: Effectively Communicate Scientific Results
Plots are an incredibly efficient and effective way to communicate your scientific results. Thus, it is worth taking the time to carefully design a paper’s plots. Doing so will ensure that the impact of your science is clear.
This section covers what questions you should ask yourself in choosing how to present your results. In ML, this is particularly challenging because we are significantly reducing the dimensionality of our solution and are often comparing many models and metrics at once.
Questions to ask yourself
Every plot should tell a story, and the goal is to identify the most concise and compelling way to tell it. When designing a plot, ask what the most important take-away messages are and which relationships among the results should be emphasized. It is also useful to distinguish between information that must be shown graphically and information that can be stated more efficiently in the text. Because figures may be the first (and sometimes only) part of a paper that a reader examines closely, this process deserves considerable time and care.
The format of the paper also imposes practical constraints. For example, whether the paper uses a single- or double-column layout determines which figure dimensions will remain legible. The appropriate type of visualization should likewise be chosen based on the scientific message. A standard two-dimensional plot is often the clearest option, while a color map can encode a meaningful third variable. Fully three-dimensional plots can also work, however the final visual representation depends significantly upon the 2D projection that is taken. Thus, as a rule of thumb, three-dimensional plots should be used only when the added dimension is essential to understanding the result. Additionally, care should be taken in selecting the projection plane that most effectively communicates the relationship.
As an example, consider the learning curves in Fig. 2, which show the loss as a function of the amount of training data for two MNIST classification tasks [12]. The plot communicates three principal conclusions: the theoretical predictions agree closely with the empirical measurements, the losses exhibit semi power-law behavior, and the two classification tasks follow quantitatively different trends. Features such as the logarithmic axes, distinct colors for each task, error bars, and consistent representations of theory and empirical results make these conclusions visible without requiring the reader to reconstruct them from the surrounding text.
Examples of Common Situations
Here, we will cover some common scenarios one might encounter and possible ways to address them. First, you will likely be in a situation where there are far too many things to plot. As a rule of thumb, plots will start to look too busy if there are more than 3-4 distinct lines. When this happens, ask which pairwise relationships are the most important to highlight to make the scientific point. Then, try to split these comparisons into multiple plots or choose a representative comparison and say the rest in words. See Fig. 3 for an example of this.
Another common situation is when you want to show the agreement between two quantities (for example theoretical prediction and empirical result) but the difference between them is much smaller than the overall shape. In the case where both the shape and agreement are important, one can add a residual plot. This residual plot shows the difference or ratio of the two quantities below the main plot. See Figure 4 for an example.

Figure 4. Figure showing two examples of residual plots. When you want to show agreement between two quantities (in this case binned data and the best fit function) but also want to show the overall shape, it can be helpful to use a residual plot. In the main plot, we show the fitted function and binned data to give an idea of the agreement and shape of the distribution. However, more information about the fit can be gained by looking at the difference or ratio of the two quantities. This can be shown in a residual plot below the main plot. In this case, it helps accentuate differences happening at the tails of the distribution which would be difficult to notice otherwise.

Figure 2 (PDF p. 27). Example of how a plot can be used to efficiently tell a story. We have modified a figure from Ref. [12] to convey three key points about the result: (1) theoretical predictions agree closely with the empirical measurements, (2) the losses exhibit semi power-law behavior, (3) the two classification tasks follow quantitatively different trends.
Plot Accessibility
An important, but often neglected, aspect of plot design is accessibility. Labels, legends, and axis ticks should be large and clear enough to read at the figure’s final printed size. Figures should include descriptive captions that explain not only what is displayed, but also the principal trends and conclusions the reader should draw from the plot. It is also important to note that the typical PDF files generated (e.g. by LaTeX) are not automatically compatible with accessibility tools such as screen readers. See Ref. [14] for an AI workflow to convert a PDF file into an accessible version.
Color choices require particular care [15] since plots should remain interpretable for readers with different forms of color vision deficiency (CVD). Ideally, information should not be encoded through color alone; instead, distinct markers or line styles should be used to provide redundant visual cues. Tools such as DaltonLens [16] and Coblis [17] can simulate different forms of CVD and help identify potential accessibility problems before publication. Color maps should also be perceptually uniform so that features are not artificially accentuated. Finally, because papers are still frequently printed in black and white, every figure should be checked in grayscale to ensure that its conclusions remain clear.

Figure 3 (PDF p. 28). Figure showing a potential fix for a plot with too many lines. The primary goal of the plot is to show that “” methods perform worse than “” methods across all choices of . However, the plot is trying to do too many pairwise comparisons at once. Since this performance gain is present for all methods (minOT, QminOT 1%, and QminOT 10%), we can simply choose a representative method (in this case QminOT 1%) and say that we see a similar trend in the other methods in the caption. If comparing the performance of the three methods is also important, one can show this in a separate plot. The data and methods for this example were taken from Ref. [13].
Coding Exercises
In this section we describe the coding exercises included in the tutorial. The corresponding code notebooks are available at jnhoward/Banff-Tutorial/. Brief solutions to the questions in the exercises are given in A.
Exercise: Build Your Own ROC Curve
Write a function that calculates a ROC curve and verify it against the built-in functions in the scikit-learn library [18]. Once you have finished, test your intuition by answering the following questions: (1) What score distributions would lead to an AUC of 0.5 (random guessing)? (2) What score distributions would lead to an AUC of 1 (perfect classifier)? (3) What is the meaning of an AUC that is less than 0.5?
Exercise: Estimate the Uncertainty
Write a function that implements jackknife resampling. For a set of mystery data, , estimate the mean of and the standard error on the mean. Estimate these quantities three ways: (1) using separate samples, (2) using bootstrap resampling, (3) using your jackknife resampling function. How close are the methods to each other? To the true value?
Acknowledgments
A huge thank you to Edward Hirst and Elli Heyes for organizing this session and encouraging us to write up our tutorials. And thanks to my fellow session leads Tomás S. R. Silva and Yidi Qi
for helping make these tutorials a success. JNH is supported by the National Science Foundation under Grant No. NSF PHY-2309135 and by a UCSB Chancellor’s Postdoctoral Fellowship.
ORCID
Jessica N. Howard - https://orcid.org/0000-0001-8295-7727
Exercise Solutions
Build Your Own ROC Curve
What score distributions would lead to an AUC of 0.5 (random guessing)? If the score distributions of both classes are perfectly overlapped every threshold will have the same TPR and FPR. Thus, the ROC curve will be a straight line from (TPR, TNR) = (0, 1) to (TPR, TNR) = (1, 0) with an integrated area (AUC) of 0.5.
What score distributions would lead to an AUC of 1 (perfect classifier)? If the score distributions of class B and class A are separated by a gap and the B scores are all greater than the A scores, then any threshold in (or above) the gap will have TNR = 1.
What is the meaning of an AUC that is less than 0.5? This simply means that the order of the distributions is inverted (A scores are greater than B scores). However, one can still effectively separate B vs A with this classifier. In the extreme case, we could have a gap between B and A, in which case the AUC is 0 but we have a perfect (inverse) classifier.
Estimate the Uncertainty
The distribution is a normal distribution with mean and variance . The mystery data was generated by drawing samples. Since is Gaussian distributed we know theoretically that the true standard error on the mean should be . Thus, the correct answer is .
However, one will find that the estimates all predict an inaccurate due to the small number of samples available. Using independent test sets has the largest uncertainty on its prediction. It predicts , making the true value just slightly one standard deviation above this prediction. Using bootstrapped samples, the Bootstrap resampling strategy predicts . It is more sure of its prediction which falls similarly far below the truth. The Jackknife resampling strategy is the most overconfident, predicting .
This illustrates the risks when dealing with limited data and indicates that is too little to accurately approximate . Resampling this empirical distribution exacerbates this effect. It also affirms that the most conservative estimates will come from using separate test sets. Thus, this is the primary strategy used in ML results, but it relies on the fact that there is typically plenty of independent data.
References
- [1]Y. LeCun, C. Cortes and C. Burges, Mnist handwritten digit database, AT & T Labs 2 (2010).
- [2]A. Krizhevsky, Learning multiple layers of features from tiny images, University of Toronto (2009).
- [3]A. Gretton, K. M. Borgwardt, M. J. Rasch, B. Schölkopf and A. Smola, A kernel two-sample test, Journal of Machine Learning Research 13(25) (2012) 723–773.DOI
- [4]R. Flamary, N. Courty, A. Gramfort, M. Z. Alaya, A. Boisbunon, S. Chambon, L. Chapel, A. Cornelios, K. Fatras, N. Fournier, L. Gautheron, N. T. Gayraud, H. Janati, A. Rakotomamonjy, I. Redko, A. Rolet, A. Schutz, V. Seguy, D. J. Sutherland, R. Tavenard, A. Tong and T. Vayer, Pot: Python optimal transport, Journal of Machine Learning Research 22(78) (2021) 1–8.
- [5]T. Plehn, A. Butter, B. Dillon, T. Heimel, C. Krause and R. Winterhalder, Modern Machine Learning for LHC Physicists (11 2022).arxiv.org/abs/2211.01421
- [6]I. Goodfellow, Y. Bengio and A. Courville, Deep Learning, (MIT Press, 2016). http://www.deeplearningbook.org.
- [7]A. S. Bosman, A. Engelbrecht and M. Helbig, Visualising basins of attraction for the cross-entropy and the squared error neural network loss functions, Neurocomputing 400 (2020) 113–136.arxiv.org/abs/1901.02302
- [8]P. Golik, P. Doetsch and H. Ney, Cross-entropy vs. squared error training: a theoretical and experimental comparison,, Proceedings of the Annual Conference of the International Speech Communication Association, INTERSPEECH (08 2013) 1756–1760.DOI
- [9]T. Fawcett, An introduction to roc analysis, Pattern Recognition Letters 27(8) (2006) 861–874, ROC Analysis in Pattern Recognition.DOI
- [10]B. Efron, The Jackknife, the Bootstrap and Other Resampling Plans (Society for Industrial and Applied Mathematics, 1982).
- [11]B. Efron, Bootstrap methods: Another look at the jackknife, The Annals of Statistics 7(1) (1979) 1–26.
- [12]J. N. Howard, R. Jefferson, A. Maiti and Z. Ringel, Wilsonian renormalization of neural network Gaussian processes, Mach. Learn. Sci. Tech. 6(2) (2025) p. 025038.DOI
- [13]N. Craig, J. N. Howard and H. Li, Exploring Optimal Transport for Event-Level Anomaly Detection at the Large Hadron Collider (1 2024).arxiv.org/abs/2401.15542
- [14]K. N. Abazajian, A visual ai solution for ada compliance, AI workflow for generating ADA compliant PDF files.
- [15]F. Crameri, G. E. Shephard and P. J. Heron, The misuse of colour in science communication, Nature Communications 11 (Oct 2020) p. 5444.DOI
- [16]Daltonlens: Online color blindness simulators, Online color-vision-deficiency simulator.
- [17]Coblis: Color blindness simulator, Online color-vision-deficiency simulator.
- [18]F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot and E. Duchesnay, Scikit-learn: Machine learning in Python, Journal of Machine Learning Research 12 (2011) 2825–2830.arxiv.org/abs/1201.0490


