from sklearn.metrics import ConfusionMatrixDisplay
{% if pipeline.task.target_columns|length == 1 %}
ConfusionMatrixDisplay.from_predictions(target_test, y_pred)
{% else %}
for i, column in enumerate(target_test.columns):
    disp = ConfusionMatrixDisplay.from_predictions(target_test[column], y_pred[:, i])
    disp.ax_.set_title(column)
{% endif %}

