[Python] ValueError: multilabel-indicator is not supported confusion matrix

Discussão em 'Python' iniciado por Stack, Setembro 23, 2024.

  1. Stack

    Stack Membro Participativo

    multilabel-indicator is not supported is the error message I get, when trying to run: can you give me any solution or hint.

    import seaborn as sns
    sns.heatmap(confusion_matrix(y_test, y_pred), annot = True)


    ValueError Traceback (most recent call last)
    <ipython-input-21-ee6823d584e9> in <cell line: 1>()
    ----> 1 sns.heatmap(confusion_matrix(y_test, y_pred), annot = True)

    /usr/local/lib/python3.10/dist-packages/sklearn/metrics/_classification.py in confusion_matrix(y_true, y_pred, labels, sample_weight, normalize)
    317 y_type, y_true, y_pred = _check_targets(y_true, y_pred)
    318 if y_type not in ("binary", "multiclass"):
    --> 319 raise ValueError("%s is not supported" % y_type)
    320
    321 if labels is None:

    ValueError: multilabel-indicator is not supported

    Continue reading...

Compartilhe esta Página