An algorithm’s sample complexity measure
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.
Generalization and risk bounds · Relate sample behavior to population risk under stated assumptions.
The project supplies finite observations and fitted parameters. A held-out sample does not establish population bounds or prove a theorem.
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: 2.4 A second descent
The source defines a measure using expected training risk as sample size changes.
In the toy, labels are independent fair bits, the algorithm predicts the first label for every example, and loss is zero-one. Its expected training risk is (m−1)/(2m).
This measure describes the algorithm’s ability to fit a sample at a chosen error threshold.
Source formula example
illustration · This is an exact analytic calculation for one toy algorithm and distribution. For other algorithms the maximum may differ, fail to exist, or be unbounded.
Symbols
- A learning algorithm.
- An i.i.d. training sample.
- The training-risk threshold.
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
Code changed. Reset to restore this example’s data flow.
You choose
input.epsilon= 0.3
Calculated here
Result expression: { maximum, expectedRiskAtMaximum, expectedRiskAtNext }
epsilon=input.epsilonUses:input.epsilonmaximum=Math.floor(1 / (1 - 2 * epsilon))Uses:epsilonexpectedRiskAtMaximum=(maximum - 1) / (2 * maximum)Uses:maximumnext=maximum + 1Uses:maximumexpectedRiskAtNext=(next - 1) / (2 * next)Uses:next
Returns
maximum- 2
expectedRiskAtMaximum- 0.25
expectedRiskAtNext- ≈0.3333
Read numbers from input and return the result. JavaScript basics.
Result
Technical statement
For the toy, the first sample is always classified correctly. Each of the remaining m−1 fair independent labels differs from the first with probability 1/2, giving expected training error (m−1)/(2m). For ε<1/2 the resulting maximum is floor(1/(1−2ε)); for ε≥1/2 it is unbounded, so the control excludes that range.
Source: Algorithm complexity