question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with logging multiple confusion matricies

See original GitHub issue

wandb, version 0.8.35 Python 3.7.7 Linux

Description

I’m trying to log a confusion matrix after each epoch using wandb.sklearn.plot_confusion_matrix(all_predictions, all_labels, class_labels, title=f'Confusion Matrix: Epoch {epoch}', normalize=True).

My expected behaviour would be multiple confusion matrices getting logged each with the appropriate title, but the actual result (shown below), is that the original matrix gets overwritten and the individual values end up written on top of each other.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
tomginsbergcommented, May 11, 2020

Here’s a good termporary fix

from sklearn.metrics import confusion_matrix
for epoch in range(num_epochs):
        ...
        cm = confusion_matrix(all_labels, all_predictions, normalize='pred')
        wandb.log({f'Confusion Matrix. Epoch {epoch}': wandb.plots.HeatMap(class_labels, 
                            class_labels, matrix_values=cm, show_text=True)})

Unfortunately plot labels don’t appear (maybe there’s a way to do this), but the most recent plot will be first on the media panel.

0reactions
ariG23498commented, Dec 3, 2020

Hey @tomginsberg In the past year we’ve majorly reworked the CLI and UI for Weights & Biases. We’re closing issues older than 6 months. Please comment to reopen.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multiple Confusion Matrix view #354 - comet-ml/issue-tracking
My question is simple - is it possible to show two confusion matrices or more within the main UI at same time? While...
Read more >
Two confusion matrix plots have different sizes - Stack Overflow
I'm trying to plot to confusion matrix in the same image, but they come out in different sizes. Here's the code:
Read more >
Confusion Matrix: How To Use It & Interpret Results [Examples]
A confusion matrix is used for evaluating the performance of a machine learning model. Learn how to interpret it to assess your model's ......
Read more >
machine learning - Kappa From Combined Confusion Matrices
I am trying to evaluate and compare several different machine learning models built with different parameters (i.e. downsampling, outlier removal) and different ......
Read more >
Evaluating machine learning models with a confusion matrix
Confusion matrices can help with side-by-side comparisons of different classification methods. You can see not only how accurate one model is over the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found