text_plain_output_1.png image_output_1.png
import statsmodels.api as sm

x_train.shape

x_train_sm = sm.add_constant(x_train)
x_train_sm

model = sm.OLS(y_train, x_train_sm)
lr_model = model.fit()

lr_model.params

lr_model.summary()