Hi, Manza. I've not worked with Pytorch but I believe it should be similar to the example I gave.
From the snippet you gave, since you already have the confusion matrix (confusion_matrix), what you need to do is create a dictionary of all the classes like this:
Then pass your confusion matrix (confusion_matrix) and the dictionary of classes (dict) to the function plot_confusion_matrix in the example I gave or a similar function, probably one you've written to your preferences.
That should output a visualization of your confusion matrix.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
hi I have 101 classes and their accuracies, I want to draw confusion matrix for them. My code is in Pytorch
A portion of my code is following
video_pred = [np.argmax(x[0]) for x in output]
Hi, Manza. I've not worked with Pytorch but I believe it should be similar to the example I gave.
From the snippet you gave, since you already have the confusion matrix (confusion_matrix), what you need to do is create a dictionary of all the classes like this:
Then pass your confusion matrix (confusion_matrix) and the dictionary of classes (dict) to the function plot_confusion_matrix in the example I gave or a similar function, probably one you've written to your preferences.
That should output a visualization of your confusion matrix.