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

Issue with logging multiple confusion matricies #1030

Closed
tomginsberg opened this issue May 11, 2020 · 6 comments
Closed

Issue with logging multiple confusion matricies #1030

tomginsberg opened this issue May 11, 2020 · 6 comments

Comments

@tomginsberg
Copy link

tomginsberg commented May 11, 2020

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.

@cvphelps
Copy link
Contributor

Hi @tomginsberg thanks for your issue. @lavanyashukla could you take a look

@lavanyashukla
Copy link
Contributor

Hi @tomginsberg thanks for reporting this! Yup, we don't currently support confusion matrices across runs, but will have a fix out soon. We'll reach out to you when we ship it :)

@tomginsberg
Copy link
Author

Thanks, guys. I'll probably implement a temporary solution myself and share it here for anyone with the same issue.

@tomginsberg
Copy link
Author

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.

@ariG23498
Copy link
Contributor

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.

@mmlynarik
Copy link

Hi, is this issue solved or not?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants