Thread
Linear Regression is a powerful tool in machine learning.

Read this 🧵 for the simplest explanation of Linear Regression.

🔽
Linear regression is an ML method, mainly used to estimate values.

For example, we can estimate:

- Price of a house
- Value of stock
- Life expectancy

1/7
Some definitions before moving on with the example:

Attributes - Data values that we use to make our predictions

Target - Value that we want to predict

2/7
We want to predict the prices of houses based on the number of rooms they have.

In this example,

Attributes - Number of rooms

Target - Price of houses

3/7
In a small dataset we have these values ⬇️

We want to predict what is the price of a house with 4 rooms

4/7
As our first step let's plot these values

There is a clear connection (correlation) between the number of rooms and prices.

5/7
The goal of linear regression is to draw a line that passes as close to data points as possible.

1. Start with a random line
2. Pick a random value - Are we close enough?
3. If no, move the line closer
4. Repeat these steps.

6/7
In the end, you will get a line that is as close to all the values as possible.

According to the model, the price of a house with 4 rooms will be around 300.

Just like that, we created a predictive ML model.

7/7
This was a really simple intro to linear regression.

Tomorrow I will share the math behind the model.

Stay tuned!

Follow @levikul09 to don't miss out!
Mentions
See All
Collections
See All