So i have a Classification Report and i am currently making it display the overall Accuracy to two decimal places. I would like to change it to display Precision instead. However, is that even possible since it is technically displaying other Metrics including Precision already?
Current Code
print(classification_report(y_train, y_pred, target_names = target_names))
print('Accuracy {:.2f}'.format(accuracy_score(y_train, y_pred)))
I would like it to then become
print(classification_report(y_train, y_pred, target_names = target_names))
print('Accuracy {:.2f}'.format(precision_score(y_train, y_pred)))
When i try this i get errors. I already tried consulting the documentation on Sklearn, but i could not find anything. Any help will be greatly appreciated.
Thanks.