Expected behavior
The classification report should not crash and instead generate a valid plot with a value of 0 for labels not present in the test data.
Traceback
Traceback (most recent call last):
File ".\test.py", line 13, in <module>
viz.score(X_test, y_test)
File "C:\Users\*\AppData\Local\Programs\Anaconda3\envs\*\lib\site-packages\yellowbrick\classifier\classification_report.py", line 210, in score
self.draw()
File "C:\Users\*\AppData\Local\Programs\Anaconda3\envs\*\lib\site-packages\yellowbrick\classifier\classification_report.py", line 223, in draw
cr_display[idx, jdx] = self.scores_[metric][cls]
KeyError: 2
Describe the bug Yellowbrick's classification_report function crashes when there are missing labels during scoring.
To Reproduce
Expected behavior The classification report should not crash and instead generate a valid plot with a value of 0 for labels not present in the test data.
Traceback
Desktop