Last answered:

11 Dec 2023

Posted on:

06 Dec 2023

0

reg.fit(x,y) gave me different answer over google colab

i have used reg.get_params() as suggested in Simple linear regression lecture. But the output whichi got is different in google colab:

{'copy_X': True, 'fit_intercept': True, 'n_jobs': None, 'positive': False}


is something m I missing please suggest.


1 answers ( 0 marked as helpful)
Instructor
Posted on:

11 Dec 2023

0

Hey Ashutosh,


Thank you for reaching out.


The version of sklearn used in the course is 0.19. In that version, the parameters of the LinearRegression class were:

- fit_intercept, defaulting to True,

- normalize, defaulting to False,

- copy_X, defaulting to True,

- and n_jobs, defaulting to 1.


https://scikit-learn.org/0.19/modules/generated/sklearn.linear_model.LinearRegression.html#sklearn.linear_model.LinearRegression


These are the values that you see in the lesson.


In subsequent sklearn versions, however, the parameters changed to the following:

- fit_intercept, defaulting to True,

- copy_X, defaulting to True,

- n_jobs, defaulting to None,

- and positive, defaulting to False.


https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LinearRegression.html


These are the values that you obtain. There is nothing to worry about and it's great that you are using a recent sklearn version.


Kind regards,

365 Hristina

Submit an answer