The Modern Mathematics of Deep Learningexplained for non-mathematicians

Bayes risk on a finite space

Penguin learning project

The project uses 342 complete Palmer penguin records: 240 training-pool and 102 held-out rows. The selected training rows determine feature scaling and model parameters. Source CSV

This project trains weights with softmax, unlike the homepage lab, which uses nearest species averages. Same penguin measurements; different classification methods. Predictions can differ.

Risk and assessment · Distinguish loss on a sample from expected loss.

The fitted rule is evaluated on 102 held-out observations, not used for fitting.

Consider this concept alongside the project; its source assumptions may differ. These observations do not prove a theorem.

Input: 12 × 2; Held-out evaluation: 102 · #58 · 40.6 mm, 193 mm. Known answer: Adélie; Prediction: Adélie · [≈0.7383, ≈0.2444, ≈0.01737].

Used in these source sections: 1.2 Learning from examples

Find the smallest risk among all label assignments on a finite input space.

The Bayes risk is the best possible population risk among measurable classifiers.

Source formula example

R∗≔inf⁡f∈M(X,Y)R(f),{\mathcal{R}}^{*}\coloneqq\inf_{f\in{\mathcal{M}}({\mathcal{X}},{\mathcal{Y}})}{\mathcal{R}}(f),

exact · The enumeration does not find a Bayes rule for arbitrary input spaces.

Symbols

R∗R*
Infimum of population risk over all measurable classifiers.
M(X,Y)M(X,Y)
Set of measurable functions from inputs to labels.
ff
A classifier.

Source formula example

This source example uses its own inputs and assumptions. Editing it does not change the project.

Edit a value or the code, then run the example. This is a finite demonstration, not a proof of the paper’s theorem.

This example’s data flow

Initial values in code

  • probabilities = [0.5, 0.25, 0.25]
  • inputIndices = [0, 1, 1]
  • labels = [1, 1, -1]
  • classifiers = [ [1, 1], [1, -1], [-1, 1], [-1, -1], ]

Calculated here

Result expression: { risks, bayesRisk: Math.min(...risks) }

  • risks = classifiers.map((f) => labels.reduce( (s, y, i) => s + probabilities[i] * (f[inputIndices[i]] !== y ? 1 : 0), 0, ), ) Uses: classifiers, labels, probabilities, inputIndices

Returns

Example result
risks
array (4 items): [0.25, 0.25, 0.75, 0.75]
bayesRisk
0.25

Read numbers from input and return the result. JavaScript basics.

Result

Enable JavaScript to run this example.

Technical statement

The toy enumerates all four deterministic binary classifiers on two input values and all three probability atoms. Its finite minimum equals the infimum.

Source: Source expression