-
Hi, I was evaluating the unet for spleen segmentation with different metrics, but I got en Error trying to compute the ROC: here is the code: and here is the Error:ValueError Traceback (most recent call last) in () /usr/local/lib/python3.7/dist-packages/monai/metrics/rocauc.py in compute_roc_auc(y_pred, y, to_onehot_y, softmax, other_act, average) ValueError: Predictions should be of shape (batch_size, n_classes) or (batch_size, ). How should I fix this? Best, Aymen |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
As the error indicates, the Some metrics make sense for classification but don't make sense for segmentation. ROC/AUC and confusion matrices are examples of this (e.g., see this blog post). |
Beta Was this translation helpful? Give feedback.
As the error indicates, the
y_pred
ofcompute_roc_auc
is expected to be a 1- or 2D array with the predicted classes. In your case, however, you are passing your segmented image.Some metrics make sense for classification but don't make sense for segmentation. ROC/AUC and confusion matrices are examples of this (e.g., see this blog post).