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?
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