StillBuggin
StillBuggin

Reputation: 280

sklearn Python and Logistic regression

Good night, community!

I have a simple question whose answer may not be as simple:

How can I show the independent variable coefficients of a Logistic regression model using Python's SciKit Learn?

Upvotes: 1

Views: 423

Answers (2)

fernandosjp
fernandosjp

Reputation: 2768

Only completing the answer above in case you want to be able to build full the linear regression equation. You woul need not only the coefficients of independent variables but also the intercept. You can access these values in the following way:

  • Coefficients: model.coef_
  • Intercept: model.intercept_

Upvotes: 1

maxymoo
maxymoo

Reputation: 36555

if model is your sklearn.linear_model.LogisticRegression then the coeffecients are accessible in model.coef_

Upvotes: 1

Related Questions