Skip to content
C

Problem 2: Visualize a Confusion Matrix as a Heatmap

Easypython

Problem Description

Write a Python program that generates a confusion matrix and visualizes it using ConfusionMatrixDisplay.

Input

Actual and predicted labels.

Output

A displayed heatmap of the confusion matrix.

Constraints

  • None specific.

Example Input

text
actual=[0,0,1,1,1], predicted=[0,1,1,1,0]

Example Output

text
(A color-coded heatmap displaying the confusion matrix values)

Concepts Covered

ConfusionMatrixDisplay, .plot().

Input (stdin)

Output

Run your code to see output here...