[scikit-learn] How is linear regression in scikit-learn done? Do you need train and test split?

Matthew Brett matthew.brett at gmail.com
Wed Jun 5 05:45:17 EDT 2019


On Wed, Jun 5, 2019 at 8:18 AM Brown J.B. via scikit-learn
<scikit-learn at python.org> wrote:
>
> 2019年6月5日(水) 10:43 Brown J.B. <jbbrown at kuhp.kyoto-u.ac.jp>:
>>
>> Contrast this to Pearson Product Moment Correlation (R), where the fit of the line has no requirement to go through the origin of the fit.
>
>
> Not sure what I was thinking when I wrote that.
> Pardon the mistake; I'm fully aware that Pearson R is merely a coefficient merely indicating direction of trend.

Ah - now I'm more confused.  r is surely a coefficient, but I
personally find it most useful to think of r as the least-squares
regression slope once the x and y values have been transformed to
standard scores.  For that case, the least-squares intercept must be
0.

Cheers,

Matthew


More information about the scikit-learn mailing list