Last active
September 3, 2019 11:16
-
-
Save PratyushTripathy/3080f80deb8f9a7da371c8734533d69a 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 confusion_matrix, precision_score, recall_score | |
# Predict for test data | |
yTestPredicted = model.predict(xTest) | |
yTestPredicted = yTestPredicted[:,1] | |
# Calculate and display the error metrics | |
yTestPredicted = (yTestPredicted>0.5).astype(int) | |
cMatrix = confusion_matrix(yTest, yTestPredicted) | |
pScore = precision_score(yTest, yTestPredicted) | |
rScore = recall_score(yTest, yTestPredicted) | |
print("Confusion matrix: for 14 nodes\n", cMatrix) | |
print("\nP-Score: %.3f, R-Score: %.3f" % (pScore, rScore)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment