How to save confusion matrix to file?

Hello,

I am wondering how can see the confusion matrix by saving it to file.

plot = interp.plot_confusion_matrix()

plot.savefig('plot_confusion_matrix.png')

print("so far so good!")

I encountered the following error:

File "vision.py", line 163, in <module>

plot.savefig('plot_confusion_matrix.png')

AttributeError: 'NoneType' object has no attribute 'savefig'

I was unknown to this and now I got to know this and now I can do the saving of the confusion matrix to the file. I have also tried it earlier but got the ERROR CODE 0XC0000428 while debugging the code.

hey
thanks for replying.
how did you save the confusion matrix to a file?

just need to add

plt.savefig('filename.png')
1 Like