popopret
popopret

Reputation: 83

How to find beta values in Logistic Regression model with sklearn

Based on the Logistic Regression function:

logit

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

beta0 and beta1

Where beta0 is the intercept and beta1 is the regression coefficient. (as per the wikipedia)

Now, I think I can get beta0 by doing model.intercept_ but I've been struggling to get beta1. Any ideas?

Upvotes: 3

Views: 9016

Answers (1)

araraonline
araraonline

Reputation: 1562

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.

Upvotes: 5

Related Questions