A sampled threshold feature
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.
Features · Transform inputs into features used by a rule.
The project scales bill and flipper measurements using training-row means and scales; its feature vector has two entries.
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: 4.2 Approximating with random pieces
Divide ξ by its length, form its dot product with x, then evaluate the two strict-positive indicators. Multiply their difference by a sign.
The toy uses one-dimensional x and ξ and chooses the sign +1. It also evaluates a two-feature list with directions −1 and +1. At zero the strict-positive indicator returns zero.
These features occur in the source’s sampling argument.
Source formula example
illustration · This is one one-dimensional feature with a chosen sign. It does not compute the expectation or establish the approximation theorem. The expression requires ξ ≠ 0.
Symbols
- A nonzero real vector used for the normalized direction.
- A real threshold.
- A sign in {−1,1}; this toy chooses +1.
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.xi= 1input.x= 1input.threshold= 0.5
Calculated here
Result expression: {
direction,
projection,
negativeIndicator,
positiveIndicator,
feature: negativeIndicator - positiveIndicator,
featureList,
}
direction=input.xi / Math.abs(input.xi)Uses:input.xiprojection=direction * input.xUses:direction,input.xnegativeIndicator=-projection - input.threshold > 0 ? 1 : 0Uses:projection,input.thresholdpositiveIndicator=projection - input.threshold > 0 ? 1 : 0Uses:projection,input.thresholdfeatureList=[-1, 1].map( (dir) => (-dir * input.x - input.threshold > 0 ? 1 : 0) - (dir * input.x - input.threshold > 0 ? 1 : 0), )Uses:input.x,input.threshold
Returns
direction- 1
projection- 1
negativeIndicator- 0
positiveIndicator- 1
feature- -1
featureList- array (2 items): [1, -1]
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: Threshold feature