lte__ - 10 months ago 58

Python Question

What mathematical model does the Linear Regression function use in scikit learn? The Ordinary Least Squares model has more than one way to minimize the cost function. I've found the form of the function it solves here, but I'm also interested which method it uses exactly. Can anyone elaborate? Thank you!

Answer

You can basically hunt around the source code enough, and you'll find it.

In

`base.py`

, you can find it uses`linal.lstsq`

.In

`linalg.py`

, you can see that`lstsq`

uses the`dglelsd`

family.This family is SVD-related. It uses SVD to solve the original problem.

Source (Stackoverflow)