Plot confusion matrix
plot_confusion_matrix(confusion_matrix, cmap=None)
Plot confusion matrix to visualize classification results.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
confusion_matrix |
ndarray
|
The confusion matrix as 2D Numpy array. Expects the first element (upper-left corner) to have True negatives. |
required |
cmap |
Optional[Union[str, Colormap, Sequence]]
|
Colormap name, matploltib colormap objects or list of colors for coloring the plot. Optional parameter. |
None
|
Returns:
Type | Description |
---|---|
Axes
|
Matplotlib axes containing the plot. |
Raises:
Type | Description |
---|---|
InvalidDataShapeException
|
Raised if input confusion matrix is not square. |
Source code in eis_toolkit/validation/plot_confusion_matrix.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
|