Statsmodels score

只愿长相守 提交于 2019-12-25 00:35:09

问题


I am running a logistic regression using statsmodels and am trying to find the score of my regression. The documentation doesn't really provide much information about the score method unlike sklearn which allows the user to pass a test dataset with the y value and the regression coefficients i.e. lr.score(test_data, target). What and how should I pass parameters to the statsmodels's score function? Documentation: http://statsmodels.sourceforge.net/stable/generated/statsmodels.discrete.discrete_model.Logit.score.html#statsmodels.discrete.discrete_model.Logit.score


回答1:


In statistics and econometrics score refers usually to the derivative of the log-likelihood function. That's the definition used in statsmodels.

Prediction performance measures for classification or regression with binary dependent variables have largely been neglected in statsmodels. An open pull request is here https://github.com/statsmodels/statsmodels/issues/1577

statsmodels does have performance measures for continuous dependent variables.




回答2:


You pass it model parameters, i.e. the coefficients for the predictors. However, that method doesn't do what you think it does: it returns the score vector for the model, not the accuracy of its predictions (like the scikit-learn score method).



来源:https://stackoverflow.com/questions/24059018/statsmodels-score

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!