Created
April 11, 2020 21:28
-
-
Save makispl/003908a448b2a14cd497fe6508f0817c 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
# Classify the messages of the test_set | |
test_set['sms_predicted'] = test_set['SMS'].apply(sms_classify_test_set) | |
# Calculate the accuracy of the algorithm | |
correct = 0 | |
total = test_set.shape[0] | |
for row in test_set.iterrows(): | |
row = row[1] | |
if row['Label'] == row['sms_predicted']: | |
correct += 1 | |
print('Results \n-------') | |
print('Valid:', correct) | |
print('Invalid:', total - correct) | |
print('Accuracy:', round(correct/total, 4)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment