Python scikit learn Linear Model Parameter Standard Error

前端 未结 2 566
太阳男子
太阳男子 2021-02-18 18:51

I am working with sklearn and specifically the linear_model module. After fitting a simple linear as in

import pandas as pd
import numpy as np
from sklearn impo         


        
2条回答
  •  温柔的废话
    2021-02-18 19:28

    No, scikit-learn does not have built error estimates for doing inference. Statsmodels does though.

    import statsmodels.api as sm
    ols = sm.OLS(y, X)
    ols_result = ols.fit()
    # Now you have at your disposition several error estimates, e.g.
    ols_result.HC0_se
    # and covariance estimates
    ols_result.cov_HC0
    

    see docs

提交回复
热议问题