Reading a Linear Prediction from Its Weights
A linear predictor combines features with coefficients and may include an intercept. Each term has meaning at the chosen input scale.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 4
- Reading time
- 1 min
In this article4 chapters
Compute one prediction
For \(y=2+3x_1-x_2\), inputs \(x_1=2,x_2=4\) give four. The intercept is two at the all-zero input. See dot products.
Check units and interpretation
If the first feature changes from meters to centimeters, its coefficient must adapt for the same predictions. Feature scaling explains why coefficient magnitudes can depend on representation.[1]
Compute intercept plus contributions in feature order
Use intercept two and weights three and minus one for two features. On input \((4,5)\), the prediction is \(2+3\cdot4-5=9\). Swapping features gives \(2+3\cdot5-4=13\), showing why the interface must preserve order and units. See matrix–vector products.
Intercept: 2
First contribution: 3×4 = 12
Second contribution: −1×5 = −5
Prediction: 9
Interpret a coefficient under the preprocessing actually used
A standardized feature changes the units associated with one coefficient. Correlated features complicate causal interpretation. Test a fixture with unequal inputs and known projected contributions.