Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write HTML table with confusion matrix in the HTML reports #26

Open
1 task
FrancescoCasalegno opened this issue Apr 20, 2022 · 0 comments
Open
1 task
Labels
🔥 New Feature 📜 Paper Needed for the Morpho Class paper

Comments

@FrancescoCasalegno
Copy link
Contributor

FrancescoCasalegno commented Apr 20, 2022

Context

  • As of now, when we run morphoclass evaluate, we generate a HTML report which includes various model performance metrics.

  • A confusion matrix is also included in this HTML report. But this confusion matrix is a PNG image:

    # model report on all samples
    cm_path = img_dir / "confusion_matrix.png"
    plot_confusion_matrix(
    metrics["confusion_matrix"], cm_path, labels=training_log.labels_str
    )
    report_html = f"""
    <div class="row">
    <br/><hr/><br/>
    <div class='col-md-6'>
    <h5>Average performance scores:</h5>
    <pre>{metrics["classification_report"]}</pre>
    </div>
    <div class='col-md-6'>
    <img src='file:{relative_to_html(cm_path)}' width='80%'>
    </div>
    </div>
    """
    report_html = textwrap.dedent(report_html).strip()

    Screenshot from 2022-04-20 15-50-29

  • This is inconvenient, because we may need to access programmatically the values in these confusion matrices later on.

Actions

  • Replace the PNG image with the confusion matrix by a HTML <table> element.
@FrancescoCasalegno FrancescoCasalegno added 🔥 New Feature 📜 Paper Needed for the Morpho Class paper labels Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔥 New Feature 📜 Paper Needed for the Morpho Class paper
Projects
None yet
Development

No branches or pull requests

1 participant