Skip to content

Instantly share code, notes, and snippets.

@thinkphp
Created January 18, 2026 11:22
Show Gist options
  • Select an option

  • Save thinkphp/d25fff8b97b0c984f305d140a6753e41 to your computer and use it in GitHub Desktop.

Select an option

Save thinkphp/d25fff8b97b0c984f305d140a6753e41 to your computer and use it in GitHub Desktop.
matrice confuzie seaborn
fig,axes = plt.subplots(1,2,figsize=(14,5))
//matricea de confuzie - antrenare
sns.heatmap(cm_train, annot = True, fmt='d', cmap='Blues', xticklabes=['Fara simptome','IC usoara', 'IC severa'],
yticklabes=['Fara simptome','IC usoara', 'IC severa'],
ax = axes[0].set_title(f"Matricea de confuzie - Antrnare / acuratete: {train_accuracy:.2%}, fontsize=12, fontweight='bold")
axes[0].set_ylabel('Etichete True',fontsize=11)
axes[0].set_xlabel('Eticheta predictie',fontsize=11))
//matricea de confuzie - testare
sns.heatmap(cm_train, annot = True, fmt='d', cmap='Blues', xticklabes=['Fara simptome','IC usoara', 'IC severa'],
yticklabes=['Fara simptome','IC usoara', 'IC severa'],
ax = axes[1].set_title(f"Matricea de confuzie - Antrnare / acuratete: {train_accuracy:.2%}, fontsize=12, fontweight='bold")
axes[1].set_ylabel('Etichete True',fontsize=11)
axes[1].set_xlabel('Eticheta predictie',fontsize=11))
plt.tight_layout()
plt.savefig('matricea_confuzie_perceptron.png', dpi=300, bbox_inches='tight')
print(f"\nGraficul matricei de confuzie a fost salvat ca matricea_confuzie_perceptron.png")
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment