Weights and Bias
Weights decide how much each input feature contributes to a score.
Bias shifts the score after the weighted sum.
For:
score = 2x_1 - 3x_2 + 4
the weights are:
w = [2, -3]
and the bias is:
b = 4
Positive weights push the score up when the feature increases. Negative weights push the score down when the feature increases. A zero weight ignores that feature for this score.
Bias as a shift
If the weighted sum is:
x . w = 6
and:
b = -2
then:
score = 6 - 2 = 4
The bias changes the score even when the input features are unchanged.
In score = 5x_1 - 2x_2 + 7, what is the bias?
Compute it first, then check your number.
HintLook for the constant
The bias does not multiply an input feature.
SolutionWork it out
The feature terms are 5x_1 and -2x_2. The constant term is 7, so the
bias is 7.
In score = 2x_1 - 3x_2 + 4, if x_2 increases by 1 and everything else stays fixed, how much does the score change?
Compute it first, then check your number.
HintUse the coefficient
The weight on x_2 tells you the score change for a one-unit change in x_2.
SolutionWork it out
The weight on x_2 is -3. Increasing x_2 by 1 changes the score by
-3.