Created
November 9, 2020 03:46
-
-
Save merishnaSuwal/5980a84983d978b31a84b1d277eb0246 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
# Get the loss and accuracy of the model by evaluation | |
loss, acc = model.evaluate(X_test, y_test) | |
# Print the loss and accuracy score for the model | |
print("%s: %.2f%%" % (model.metrics_names[0], loss*100)) | |
print("%s: %.2f%%" % (model.metrics_names[1], acc*100)) | |
# Predicting the output predictions | |
y_pred = model.predict(X_test).round() | |
# Calculating the F1 score, recall, and precision | |
print("%s: %.2f%%" % ("F1-score", f1_score(y_test, y_pred)*100)) | |
print("%s: %.2f%%" % ("Recall", recall_score(y_test, y_pred)*100)) | |
print("%s: %.2f%%" % ("Precision", precision_score(y_test, y_pred)*100)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment