The Modern Mathematics of Deep Learningexplained for non-mathematicians

The optimal binary label

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.

Prediction rules and layers · Describe or apply prediction rules, layers and parameters.

The project uses a linear rule with two features. The fitted weights produce scores or normalized mass.

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

For labels −1 and +1, first compute the conditional mean of Y at x. Then apply the source sign convention, which returns +1 at zero.

In the toy, the conditional probability of +1 is p and that of −1 is 1−p.

This rule selects a label with minimum conditional classification risk.

Source formula example

f∗(x)=sgn⁡(E[Y∣X=x])f^{*}(x)={\operatorname{sgn}}({\mathbbm{E}}[Y|X=x])

exact · The toy assumes the conditional probabilities are known. A finite training sample does not generally give the exact conditional mean.

Symbols

YY
A label in {−1,1}.
XX
The input; the conditional probabilities refer to the selected x.

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.p = 0.75

Calculated here

Result expression: { conditionalMean, prediction, conditionalRisk }

  • p = input.p Uses: input.p
  • conditionalMean = p - (1 - p) Uses: p
  • prediction = conditionalMean >= 0 ? 1 : -1 Uses: conditionalMean
  • conditionalRisk = prediction === 1 ? 1 - p : p Uses: prediction, p

Returns

Example result
conditionalMean
0.5
prediction
1
conditionalRisk
0.25

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

Result

Enable JavaScript to run this example.

Technical statement

Under binary zero-one classification, either label is optimal when the conditional mean is zero. The source convention chooses +1 at that boundary. Conditional expectations at a specific x require a suitable version when the input distribution is continuous.

Source: Bayes classifier