Is linear regression and ordinary least squares (OLS) the same thing ?
Linear regression is a vast term that just says we are finding a relationship between the dependent and independent variable(s), no matter what technique(or mathematics) we are using.
OLS is just one of the technique to do linear regression.
Lets say,
error(e) = (observed value — predicted value)
Observed values → blue dots in picture below.
predicted values →points on the line(vertically below to the observed values)

The vertical lines above represent error `
e
`.We square them -> add them together and get total err.
And we try to reduce this total error using other methods like gradient descent.
For OLS, as the name says (ordinary least squared method), here we reduce the sum of all e² i.e. we try to make the error least.
I hope now you get the point that OLS is just one of the many techniques to implement linear regression.
I hope it was helpful!
You can find me on Linkedin here.
brijeshgoyal0808@gmail.com
Thanks for reading :)