Commit 64563c6a authored by Petra's avatar Petra
Browse files

accuracy computation separate from print

parent bca2d502
......@@ -43,7 +43,9 @@ print("\n Actual Predicted")
for i in range(10):
print("{0:6.2f} {1:8.2f}".format(y_test[i], y_pred[i]))
print(""" -- Performance ---""")
print("Accuracy \t{0:5.2f}".format( metrics.accuracy_score(y_test, y_pred)))
accuracy = metrics.accuracy_score(y_test, y_pred)
print("Accuracy \t{0:5.2f}".format(accuracy))
""" Visualize the tree """ #
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment