Question

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

Was it helpful?

Solution

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.

OTHER TIPS

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).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top