Last answered:

08 Oct 2020

Posted on:

03 Sept 2020


Coefficients differ in statsmodels and sklearn

I decided to do feature scaling exercise in ML (linear regression) part of the course and used both stats models and sklearn for practice. However, I obtained different coefficients, even though I got the same predicted values. Is it due to scaling or did I do something wrong with coefficients?

1 answers ( 0 marked as helpful)
Posted on:

08 Oct 2020

Hi Emin, This is a great observation! In fact, the two libraries are using different methods to estimate the regression line, therefore, resulting in different coefficients! Best, The 365 Team

Submit an answer