Confusion matrix visualization.

Functions

Func

plot_confusion_matrix

Line 22
plot_confusion_matrix(y_true: np.ndarray, y_pred: np.ndarray, labels: List[str]=None, title: str='Confusion Matrix', figsize: Tuple[int, int]=(), save_path: str=None, normalize: bool=False, cmap: str='Blues', show_values: bool=True, show_colorbar: bool=True, show_grid: bool=False)

Plot confusion matrix.

Parameters

y_true
ndarray
True labels.
y_pred
ndarray
Predicted labels.
labels
list of str
Class labels for display.
title
str
Plot title.
figsize
tuple
Figure size.
save_path
str
Path to save figure.
normalize
bool = False
Normalize the confusion matrix (show percentages).
cmap
str = 'Blues'
Colormap name.
show_values
bool = True
Show values in cells.
show_colorbar
bool = True
Show colorbar.
show_grid
bool = False
Whether to show axis grid lines.