Calculate accuracy in Binary classification - PyTorch Forums
https://discuss.pytorch.org/t/calculate-accuracy-in-binary-classification/9175805.08.2020 · Hi I have a NN binary classifier, and the last layer is sigmoid, I use BCEloss this is my accuracy calculation: def get_evaluation(y_true, y_prob, list_metrics, epoch): # accuracy = accuracy_score(y_true, y_prob) y_prob = np.array(y_prob) y_prob = np.where(y_prob <= 0.5, 0, y_prob) y_prob = np.where(y_prob > 0.5, 1, y_prob) accuracy = metrics.accuracy_score(y_true, …