Skip to content

Commit

Permalink
Add str() to variables being printed
Browse files Browse the repository at this point in the history
I realized that the variables weren't strings despite having "%s" (I thought the "s" meant string) in Python 2. That is what you get for only dealing with Python 3. :P
  • Loading branch information
dgcampbe authored Mar 2, 2018
1 parent ce2c044 commit 998e51b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mnist_svm.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def svm_baseline():
predictions = [int(a) for a in clf.predict(test_data[0])]
num_correct = sum(int(a == y) for a, y in zip(predictions, test_data[1]))
print("Baseline classifier using an SVM.")
print(num_correct + " of " + len(test_data[1]) + " values correct.")
print(str(num_correct) + " of " + str(len(test_data[1])) + " values correct.")

if __name__ == "__main__":
svm_baseline()
Expand Down

0 comments on commit 998e51b

Please sign in to comment.