The Modern Mathematics of Deep Learningexplained for non-mathematicians

Classification risk

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

Average the misclassification indicator over the full probability distribution.

Risk measures the chance of an incorrect prediction.

Source formula example

R(f)=E[1(−∞,0)(Yf(X))]=P[f(X)≠Y].{\mathcal{R}}(f)={\mathbbm{E}}[\mathds{1}_{(-\infty,0)}(Yf(X))]={\mathbbm{P}}[f(X)\neq Y].

exact · This exact finite population is invented and is not an empirical estimate.

Symbols

R(f)R(f)
Population classification risk.
X,YX,Y
Random input and binary label.
ff
Classifier returning −1 or +1.
𝔼,P𝔼, ℙ
Expectation and probability under the data distribution.

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

You choose

  • input.second = 1

Initial values in code

  • probabilities = [0.5, 0.5]
  • labels = [-1, -1]

Calculated here

Result expression: { indicators, risk: indicators.reduce((s, v, i) => s + v * probabilities[i], 0), }

  • predictions = [-1, input.second] Uses: input.second
  • indicators = predictions.map((v, i) => (labels[i] * v < 0 ? 1 : 0)) Uses: predictions, labels

Returns

Example result
indicators
array (2 items): [0, 1]
risk
0.5

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

Result

Enable JavaScript to run this example.

Technical statement

The finite probability space is exactly enumerated, with two equally likely atoms. The equality to ℙ[f(X) ≠ Y] assumes binary classifier outputs ±1.

Source: Source expression