Last active
July 24, 2017 12:17
-
-
Save shivamkalra/3981b0e90666cfead10cdb86d5592064 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn.metrics import accuracy_score | |
import statsmodels.api as sm | |
logit = sm.Logit(Y_train, X_train) | |
result = logit.fit() | |
print(result.summary2()) | |
Y_p = np.zeros((len(Y_test), 1)) | |
p = result.predict(X_test) | |
Y_p[p > 0.5] = 1. | |
print(accuracy_score(Y_test, Y_p)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment