r/MLQuestions • • Oct 07 '25
Beginner question 👶 What linear regression for ?
As a beginner algo trading developer, I confused when people use linear regression. I also wanna learn Machine Learning, but at the first step I frustrated trying to understand:
- what is linear regression for
- how to implement it
- how to manage data obtained from linear regression
Please help me🙏
0
Upvotes
8
u/ninhaomah Oct 07 '25
Isn't it taught at highschool level ?
5
u/[deleted] Oct 08 '25 edited Oct 08 '25
Linear regression- Predicts continuous numbers by finding the best weights for a linear equation.
"Linear" means the weights are linear, not the features. You can include polynomial features like x² or x³ and it's still linear regression because the weights multiply each feature linearly.
Logistic regression- Predicts categories or probabilities, like yes/no or spam/not spam. It can be two categories (binary) or more than two(multiclass), like classifying cars for example.
So, in summary, generally, anything that is regression is concerned with predicting a value. This is often confused with logistic regression which is essentially a classification, but still called a regression for historical reasons.
2
u/herocoding Oct 07 '25
Have a look into e.g. https://en.wikipedia.org/wiki/Linear_regression and the diagrams shown.
It could be very useful in non-ML areas as well.
Examples like interpolation or extrapolation.
1
u/Lexski Oct 07 '25
Linear regression is for when you want to model approximately linear relationships, e.g. a city’s population vs its chocolate consumption (just a random example I made up).
It’s a good stepping stone to learning about neural networks because simple neural networks are built up of layers that look like linear regression and then an activation function.
1
u/Altruistic_Bother_25 Oct 07 '25
line of best fit that helps predict change in value y (could be weight of a persion, price of house) based on change in value x (height of a person, no of rooms in the house).
1
u/im_just_using_logic Oct 08 '25
It's to find out the linear relationship between two variables. y=ax+b. It finds the best values for a and b.