A line equation describes every point on a straight line. In the form y = mx + b, m is the slope and b is the y-intercept: the slope controls direction, while the intercept controls position. section 3.4 section 3.11
Read the equation through its two parameters:
- Slope measures rise over run. A positive slope rises, a negative slope falls, and a zero slope produces a horizontal line. section 3.11
- The y-intercept is where the line crosses the vertical axis; changing it moves the line up or down without changing its slope. section 3.11
- In a machine learning model, the slope acts as a feature weight and the intercept acts as a bias. section 3.4
House prices
The rule Price = 100 + 50(Number of rooms) describes a line with slope 50 and intercept 100. Each additional room raises the predicted price by 50, while 100 is the base price when the room count is zero; a small error accounts for imperfect predictions. section 3.4
Figure 3.8 Some examples of slope and y-intercept. On the left, we see several lines with the same intercept and different slopes. Notice that the higher the slope, the steeper the line. On the right, we see several lines with the same slope and different y-intercepts. Notice that the higher the y-intercept, the higher the line is located.
Compare lines sharing an intercept or a slope to see how steepness and vertical position change independently. section 3.11

