Skip to content

Commit c12cdac

Browse files
committed
fix(skore): Add tests and follow-up fixes for ConfusionMatrixDisplay (#2165)
Fixes #2160, improves on #1759. cc @glemaitre
1 parent 93c8a23 commit c12cdac

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

โ€Žskore/src/skore/_sklearn/_plot/metrics/confusion_matrix.pyโ€Ž

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,10 @@ def _plot_single_estimator(
178178
heatmap_kwargs or {},
179179
)
180180
normalize_by = "normalized_by_" + normalize if normalize else "count"
181-
cm_pivot = cm.pivot(
182-
index="True label", columns="Predicted label", values=normalize_by
183-
).reindex(index=self.display_labels, columns=self.display_labels)
184181
sns.heatmap(
185182
cm.pivot(
186183
index="true_label", columns="predicted_label", values=normalize_by
187-
),
184+
).reindex(index=self.display_labels, columns=self.display_labels),
188185
ax=self.ax_,
189186
**heatmap_kwargs_validated,
190187
)
@@ -240,7 +237,8 @@ def _compute_data_for_display(
240237
241238
**kwargs : dict
242239
Additional keyword arguments that are ignored for compatibility with
243-
other metrics displays. Accepts but ignores `estimators` and `data_source`.
240+
other metrics displays. Accepts but ignores `estimators`, `ml_task`,
241+
and `data_source`.
244242
245243
Returns
246244
-------

0 commit comments

Comments
ย (0)