Last active
September 8, 2018 11:16
-
-
Save baatout/3b4835948d8a22603122d7c8daa2c614 to your computer and use it in GitHub Desktop.
Save model coefficients
This file contains 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
# with X_train, X_test, Y_train, Y_test | |
from sklearn.linear_model import LogisticRegression | |
clf = LogisticRegression() | |
clf.fit(X_train, Y_train) | |
print(clf.score(X_test, Y_test)) | |
import json | |
with open('logreg_coefs', 'w') as f: | |
json.dump(clf.coef_.tolist(), f) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment