Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Obtaining summary from logistic regression(Python)

model = LogisticRegression(random_state=0)
model.fit(X2, Y2)
Y2_prob=model.predict_proba(X2)[:,1]

I've built a logistic regression model on my training dataset X2 and Y2. Now is it possible for me to obtain the coefficients and p values from here? Because:

model.summary()

gives me:

AttributeError: 'LogisticRegression' object has no attribute 'summary'

Or can somebody help me suggest an alternative to obtain the important and significant features from this model? Any help will be appreciated. Thanks.

like image 408
IndigoChild Avatar asked Feb 16 '18 05:02

IndigoChild


1 Answers

No. Its not possible to get the p-values from here. You can get the coefficients however by using model.coef_. If you need the p-values you'll have to use the statsmodels package. See this if you want to modify the sklearn class to get the p-values

like image 50
Clock Slave Avatar answered Nov 14 '22 14:11

Clock Slave