Untitled

 avatar
unknown
plain_text
3 months ago
742 B
4
Indexable
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt

# Define the values for the confusion matrix
true_positive = 50
true_negative = 78
false_positive = 43
false_negative = 48

# Create the confusion matrix
conf_matrix = np.array([[true_positive, false_negative],
                        [false_positive, true_negative]])

# Plot the confusion matrix using Seaborn
plt.figure(figsize=(6, 5))
sns.heatmap(conf_matrix, annot=True, fmt="d", cmap="Blues", 
            xticklabels=["Predicted Positive", "Predicted Negative"], 
            yticklabels=["Actual Positive", "Actual Negative"])

# Title and labels
plt.title("Confusion Matrix")
plt.xlabel("Predicted")
plt.ylabel("Actual")

plt.show()
Editor is loading...
Leave a Comment