Mean surrogate loss
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.
Objectives · Combine losses and penalties into a criterion for parameters or rules.
Project predictions and known answers produce losses. Classification uses cross-entropy and α/2 times squared non-bias weights; Ridge uses normalized-mass MSE and α times all squared coefficients, including the intercept.
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
Evaluate the surrogate loss on each training example, then average.
A surrogate can replace a discontinuous classification error during optimization.
Source formula example
exact · This finite sample mean is not the population risk.
Symbols
- Surrogate loss on one example.
- Prediction function.
- Training example i.
- Number of examples.
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.score= 0
Initial values in code
labels=[1, -1]
Calculated here
Result expression: { losses, mean: losses.reduce((a, b) => a + b, 0) / losses.length }
scores=[input.score, 0]Uses:input.scorelosses=scores.map((v, i) => Math.log(1 + Math.exp(-labels[i] * v)))Uses:scores,labels
Returns
losses- array (2 items): [≈0.6931, ≈0.6931]
mean- ≈0.6931
Read numbers from input and return the result. JavaScript basics.
Result
Technical statement
The invented sample has two labels and uses logistic surrogate loss.
Source: Source expression