Last active
December 29, 2018 19:58
-
-
Save rohanjoseph93/bc3db1e43adfc27d0f21710c4865f5d0 to your computer and use it in GitHub Desktop.
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
#Logistic regression | |
from sklearn.linear_model import LogisticRegression | |
clf = LogisticRegression().fit(X_train,y_train) | |
y_pred = clf.predict(X_test) | |
# Model Evaluation metrics | |
from sklearn.metrics import accuracy_score,recall_score,precision_score,f1_score | |
print('Accuracy Score : ' + str(accuracy_score(y_test,y_pred))) | |
print('Precision Score : ' + str(precision_score(y_test,y_pred))) | |
print('Recall Score : ' + str(recall_score(y_test,y_pred))) | |
print('F1 Score : ' + str(f1_score(y_test,y_pred))) | |
#Logistic Regression Classifier Confusion matrix | |
from sklearn.metrics import confusion_matrix | |
print('Confusion Matrix : \n' + str(confusion_matrix(y_test,y_pred))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment