10 Tweets 2 reads Feb 09, 2024
Linear Regression clearly explained:
Linear regression is a method also used in ML, to estimate values.
For example, we can estimate:
- Price of a house
- Value of stock
- Life expectancy
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
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
In a small dataset, we have these values ⬇️
We want to predict what is the price of a house with 4 rooms
As our first step let's plot these values
There is a clear connection (correlation) between the number of rooms and prices.
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.
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.
That's it for today.
I hope you've found this thread helpful.
Like/Retweet the first tweet below for support and follow @levikul09 for more Data Science threads.
Thanks 😉
If you haven't already, join our newsletter DSBoost.
We share:
• Interviews
• Podcast notes
• Learning resources
• Interesting collections of content
dsboost.dev

Loading suggestions...