Adding a Bias
Look at the chart we just plotted. Our line is not quite the best approximation of the examples, is it? The perfect line would have less slope, and it wouldn’t pass by the origin. Give or take, it would cross the “Pizzas” axis around the value of 10.
So far, we forced the line to pass by the origin to keep our model as simple as we could. It’s time to remove that constraint. To draw a line that is not constrained to pass by the origin, we need one more parameter in our model:
| ŷ = x * w + b |
You might experience déjà vu here. This equation is the classic linear function which you may have studied in 8th grade. Most people would remember it as y = m * x + b, where m is called the “slope” and b is called the “y-intercept.” Here, we’ll ...
Get Programming Machine Learning now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.