Make optional argmax for y_pred in Confusion Matrix, Precision, Recall, Accuracy
See original GitHub issue🚀 Feature
Today, the conditions on the input of the Confusion Matrix, (and Precision, Recall, Accuracy in multiclass case) are the following:
- `y_pred` must contain logits and has the following shape (batch_size, num_categories, ...)
- `y` should have the following shape (batch_size, ...) and contains ground-truth class indices
with or without the background class. During the computation, argmax of `y_pred` is taken to determine predicted classes.
Taking argmax on y_pred
can be an option if we would like to determine winning class by some other rule. Let’s keep argmax as default behaviour if y_pred
is (N, C, ...)
and do not apply it if y_pred.shape == y.shape
and (N, ...)
.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
How to Calculate Precision, Recall, F1, and More for Deep ...
How can I calculate the F1-score or confusion matrix for my model? In this tutorial, you will discover how to calculate metrics to...
Read more >deep learning RestNet problem calculate confusion matrix ...
i am new to deep learning. I am running a code to train and test a model and find its precision recall f1-score...
Read more >Performance Metrics: Confusion matrix, Precision, Recall, and ...
The confusion matrix, precision, recall, and F1 score gives better intuition of prediction results as compared to accuracy.
Read more >sklearn.metrics.classification_report — scikit-learn 1.2.0 ...
Compute precision, recall, F-measure and support for each class. confusion_matrix. Compute confusion matrix to evaluate the accuracy of a classification.
Read more >Source code for ignite.metrics.confusion_matrix - PyTorch
During the computation, argmax of `y_pred` is taken to determine ... If `average="recall"` then confusion matrix values are normalized such ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok I do it soon
If
y_pred
has C dimension like(N, C, ...)
there is no way to compute a metric without taking argmax withy_true
as(N, ...)
. In this case we should take argmax without an option, IMO.yes. In this case, user can perform winning class selection in
output_transform
or anywhere before metrics update.