You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
在看过源码后,发现selection.py中StatsModel的loglikelihood计算方法是统一用了mse,按我的理解源码里的公式应该只能用在estimator是ols的情况,lr的loglikelihood的计算应为 sum over i( yi * beta^t * xi - log( 1 + exp( beta^t * xi )))。
我尝试借助statsmodels库里封装的逻辑回归,以aic为criteria,自己写了lr的stepwise regression,发现与toad的stepwise中得出的最终结果不一致,最后发现用toad筛选出的模型的aic与statsmodels中计算得到的aic值不同。
在看过源码后,发现selection.py中StatsModel的loglikelihood计算方法是统一用了mse,按我的理解源码里的公式应该只能用在estimator是ols的情况,lr的loglikelihood的计算应为 sum over i( yi * beta^t * xi - log( 1 + exp( beta^t * xi )))。
而且对于lasso和ridge来说,同样用ols的mse计算方式来计算loglikelihood应该也不合适,我目前还在查找lasso和ridge的aic和bic应该怎么算比较合理。
The text was updated successfully, but these errors were encountered: