Python 线性建模入门
Jason Vestuto
Data Scientist
模型预测与RMSE:
模型参数与标准误差:
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
Python 线性建模入门