Sum and mean
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.
Classification predicts three species; Ridge predicts body mass in grams using the same observations. These are separate models. Training predictions feed the objective; 102 separate test predictions never update the weights.
Vectors and matrices · Combine numbers using vector and matrix operations.
Project vectors have two features; the training matrix has n rows and two columns. Mathematical tools may operate on these values when their assumptions apply.
Mean training loss
- Input
- 12 Loss
- Output
- ≈0.228
Project operation
The project calculation uses these records; the source formula and example follow below. Code edits run locally; project settings travel between pages.
Loss → Mean training loss → Objective
Project input
Showing first three entries; the operation receives the complete array. Rounded preview; the operation uses full precision.
input.losses· Loss[≈0.005482, ≈1.012, ≈0.1422] … (12 entries)
Result
≈0.228
Teaching example; no specific paper passage attached.
Add the numbers, then divide by how many there are. The symbol Σ asks us to add terms.
A mean summarizes a finite set of values.
Source formula example
exact · The result is exact for these finite toy inputs, apart from ordinary computer rounding.
Symbols
- Number of values, a positive integer.
- Value at position i, counting from one.
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.first= 1
Calculated here
Result expression: { sum, mean: sum / values.length }
values=[input.first, 2, 3]Uses:input.firstsum=values.reduce((total, value) => total + value, 0)Uses:values
Returns
sum- 6
mean- 2
Read numbers from input and return the result. JavaScript basics.
Result
Technical statement
Change the input and run the same code again. The displayed result uses the values shown above.
Source: Teaching example