问题
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