votes up 1

Samplewise metrics are not available outside of multilabel classification.

Exception Class:

Raise code

      n_labels = len(labels)
        labels = np.hstack([labels, np.setdiff1d(present_labels, labels,

    if y_true.ndim == 1:
        if samplewise:
            raise ValueError("Samplewise metrics are not available outside of "
                             "multilabel classification.")

        le = LabelEncoder()
        y_true = le.transform(y_true)
        y_pred = le.transform(y_pred)
        sorted_labels = le.classes_

        # l
😲  Walkingbet is Android app that pays you real bitcoins for a walking. Withdrawable real money bonus is available now, hurry up! 🚶

Ways to fix

votes up 1 votes down

Please check your metrics input, it may be empty! (This is the reason for my same error.)

Nov 10, 2022 wm-CSU answer
wm-CSU 502

Add a possible fix

Please authorize to post fix