SciKit Learn - Mathematical model behind linear regression?
<p>What mathematical model does the <a href="http://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LinearRegression.html#sklearn.linear_model.LinearRegression" rel="nofollow">Linear Regression</a> 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 <a href="http://scikit-learn.org/stable/modules/linear_model.html" rel="nofollow">here</a>, but I'm also interested which method it uses exactly. Can anyone elaborate? Thank you!</p>

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

<ul>
<li><p>In <a href="https://github.com/scikit-learn/scikit-learn/blob/51a765a/sklearn/linear_model/base.py#L349" rel="nofollow"><code>base.py</code></a>, you can find it uses <code>linal.lstsq</code>.</p></li>
<li><p>In <a href="https://github.com/numpy/numpy/blob/master/numpy/linalg/linalg.py" rel="nofollow"><code>linalg.py</code></a>, you can see that <code>lstsq</code> uses the <a href="https://software.intel.com/sites/products/documentation/doclib/mkl_sa/11/mkl_lapack_examples/dgelsd.htm" rel="nofollow"><code>dglelsd</code> family</a>. </p></li>
<li><p>This family is SVD-related. It <a href="http://math.stackexchange.com/questions/974193/why-does-svd-provide-the-least-squares-solution-to-ax-b">uses SVD to solve the original problem</a>.</p></li>
</ul>

python math scikit-learn linear-regression