標準誤

Python 線性建模入門

Jason Vestuto

Data Scientist

預測的不確定性

模型預測與 RMSE:

  • 預測與資料比較得殘差
  • 殘差有分佈(離散程度)
  • RMSE 衡量殘差的分散
  • RMSE 量化預測好壞
Python 線性建模入門

參數的不確定性

模型參數與標準誤:

  • 參數值作為中心
  • 參數標準誤作為分散
  • 標準誤衡量參數不確定性
Python 線性建模入門

計算標準誤

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
Python 線性建模入門

計算標準誤

e0 = model_fit.bse['Intercept']
e1 = model_fit.bse['times']
standard_error_of_intercept = e0
standard_error_of_slope = e1
Python 線性建模入門

一起來練習吧!

Python 線性建模入門

Preparing Video For Download...