Last answered:

20 May 2024

Posted on:

17 May 2024

0

Resolved: why we used fit method & exaclty what does it do to both the deependent and independent variables.

what will happen if i dont use fitt method?

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

20 May 2024

0

Hi Bharat!

Thanks for reaching out!

The fit() method estimates the coefficients of the regression model. For a simple linear regression, these are the slope and the intercept. When you call fit(), the method applies the OLS algorithm to fit the regression line to the data. The method uses the independent variable (in this case, SAT + a constant for the intercept) to predict the dependent variable (GPA).

So, if you don't use the fit() method, the model coefficients won't be estimated, and you won't have a fitted model to make predictions or evaluate the relationship between the dependent and independent variables. Moreover, without it, you won't have access to the model summary or any of the statistical measures.

Hope this helps.

Best,

Ivan

Submit an answer