Simple Linear regression is the most basic machine learning algorithm. When getting started with machine learning, linear regression is where you should start, hence this being the first of the machine learning training category on The Concept Center.
What is Linear Regression?
Linear regression in simple terms is a statistical way of measuring the relationship between variables. Such as, as time increases, so does cost.
Why does linear regression matter? Simply put, you can predict the future!
House Price Example
Let’s use an example where we are trying to predict the price of a house given the square footage and the price per square footage. In Seattle Washington, the price per square foot for homes is $236. If we are to map this value, the graph below is what it would look like:
At 1,000 square feet, the value is $236,000. What is the value at 2,005 square feet? If we are to draw a point on the graph above, we can guess that it’s around $473,180.
What is the Math?
The math behind simple linear regression is:
y = mx + b
- y – the predicted value
- m – the slope or the constant
- x – the input value
- b – the bias
Implement the Math
Using the same formula:
y = mx + b
We can now substitute the values:
- y – the house price
- m – $236 square footage average price
- x – square footage input
- b – $0
Now we plugin the values:
y = $236 * 2,005 + $0
y = $473,180
From this article and video, you were able to understand what simple linear regression is, what the math looks like, and how to implement linear regression in a simple problem. Please provide any comments to help improve this post or video for future learners.