Commit 64563c6a authored by Petra's avatar Petra

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 """ # https://scikit-learn.org/stable/auto_examples/tree/plot_unveil_tree_structure.html#sphx-glr-auto-examples-tree-plot-unveil-tree-structure-py
......
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