braindecode.visualization.plot_confusion_matrix(confusion_mat, class_names=None, figsize=None, colormap=<matplotlib.colors.LinearSegmentedColormap object>, textcolor='black', vmin=None, vmax=None, fontweight='normal', rotate_row_labels=90, rotate_col_labels=0, with_f1_score=False, norm_axes=(0, 1), rotate_precision=False, class_names_fontsize=12)

Generates a confusion matrix with additional precision and sensitivity metrics as in [1].

confusion_mat: 2d numpy array

A confusion matrix, e.g. sklearn confusion matrix:

class_names: array, optional

List of classes/targets.

figsize: tuple, optional

Size of the generated confusion matrix figure.

colormap: matplotlib cm colormap, optional
textcolor: str, optional

Color of the text in the figure.

vmin, vmax: float, optional

The data range that the colormap covers.

fontweight: str, optional

Weight of the font in the figure: [ ‘normal’ | ‘bold’ | ‘heavy’ | ‘light’ | ‘ultrabold’ | ‘ultralight’]

rotate_row_labels: int, optional

The rotation angle of the row labels

rotate_col_labels: int, optional

The rotation angle of the column labels

with_f1_score: bool, optional
norm_axes: tuple, optional
rotate_precision: bool, optional
class_names_fontsize: int, optional
fig: matplotlib figure



Schirrmeister, R. T., Springenberg, J. T., Fiederer, L. D. J., Glasstetter, M., Eggensperger, K., Tangermann, M., Hutter, F. & Ball, T. (2017). Deep learning with convolutional neural networks for EEG decoding and visualization. Human Brain Mapping , Aug. 2017. Online:

Examples using braindecode.visualization.plot_confusion_matrix