Introduction to Linear Modeling in Python
Jason Vestuto
Data Scientist
Model Predictions and RMSE:
Model Parameters and Standard Error:
df = pd.DataFrame(dict(times=x_data, distances=y_data))
model_fit = ols(formula="distances ~ times", data=df).fit()
a1 = model_fit.params['times']
a0 = model_fit.params['Intercept']
slope = a1
intercept = a0
e0 = model_fit.bse['Intercept']
e1 = model_fit.bse['times']
standard_error_of_intercept = e0
standard_error_of_slope = e1
Introduction to Linear Modeling in Python