Plotting confusion matrix

    0

    0

    The confusion matrix plots the number of times each class was predicted incorrectly as a function of the number of times each class was labeled.

    # Plot the confusion matrix
    plt.figure(figsize=(10, 8))
    sns.heatmap(
      confusion_mtx, xticklabels=class_names, yticklabels=class_names, annot=True, fmt="g"
    )
    plt.xlabel("Prediction")
    plt.ylabel("Label")
    plt.title("Validation Confusion Matrix")
    plt.show()
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.