Welcome to the lesson on linear regression! This technique helps us find a straight-line pattern between two sets of numbers.
For example, if you have a list of people's heights and their shoe sizes, linear regression finds the line that best connects these pairs so you can predict one from the other.
Engagement Message
Can you think of two numbers in your life that seem to change together?
Linear regression is useful when one thing increases as another does. For example, as the size of a house gets bigger, its price usually goes up too. The algorithm finds the line that best describes this pattern, so we can predict prices from sizes.
Engagement Message
What are some other examples where two things increase together?
A straight line is defined by its slope and intercept. The slope shows how much one value changes when the other increases by one. The intercept is where the line crosses the y-axis, or the starting value when x is zero.
Engagement Message
In your own words, what does the slope tell us?
Let's work with real numbers! Say we have two houses:
The slope formula for a line between two points is: (y₂ - y₁) ÷ (x₂ - x₁)
Engagement Message
Can you calculate the slope using these two points?
Using our houses: Slope = ($300,000 - $200,000) ÷ (2,000 - 1,000) = $100,000 ÷ 1,000 = $100 per sq ft.
