Not Monitored
Tag not monitored by Microsoft.
40,162 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
def plot(cm):
"""
Plot the confusion matrix with adjusted annotations.
"""
sns.set(rc={"figure.figsize": (6, 4)}) # Adjusted figure size for clarity
ax = sns.heatmap(cm, annot=True, fmt='g', cmap="Blues", cbar=True, annot_kws={"size": 14})
ax.set_title("Confusion Matrix")
ax.set_xlabel("Predicted label")
ax.set_ylabel("True label")
# Explicitly set the axis limits to avoid any cutoffs
ax.set_ylim(len(cm), 0)
plt.show()
# Test with a simpler example (use integer values)
cm = np.array([[42586, 63], [54, 19]], dtype=int) # Converted floating-point to integers for clarity
plot(cm)
I'm new to using Microsoft Fabric enviroment. However, I'm facing an issues with the FN and FP values not showing in the plot.