How to find beta values in Logistic Regression model with sklearn

若如初见. 提交于 2019-12-23 16:43:45

问题


Based on the Logistic Regression function:

I'm trying to extract the following values from my model in scikit-learn.

and

Where

is the intercept and

is the regression coefficient. (as per the wikipedia)

Now, I think I can get

by doing model.intercept_ but I've been struggling to get

. Any ideas?

回答1:


You can access the coefficient of the features using model.coef_.

It gives a list of values that corresponds to the values beta1, beta2 and so on. The size of the list depends on the amount of explanatory variables your logistic regression uses.



来源:https://stackoverflow.com/questions/47045025/how-to-find-beta-values-in-logistic-regression-model-with-sklearn

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