sleepless.utils.misclassification#

Compute misclassified Epochs and function to visualize them.

Functions

compute_misclassification(sample[, ...])

Compute the misclassification epochs of a sample.

plot_misclassified_epochs(sample[, ...])

Generate a plot and a dictionary of the misclassified epochs.

sleepless.utils.misclassification.compute_misclassification(sample, return_well_classified=False)[source]#

Compute the misclassification epochs of a sample.

Parameters:
  • sample (DelayedSample) – a sample of a dataset

  • return_well_classified (bool) – If True, the function return well classified epochs instead of misclassified

Return type:

tuple[Epochs, dict[str, ndarray]]

Returns:

the misclassified epochs and a dictionary with label, prediction and labels of the misclassified epochs.

sleepless.utils.misclassification.plot_misclassified_epochs(sample, vizu_epochs=False, return_well_classified=False)[source]#

Generate a plot and a dictionary of the misclassified epochs.

Parameters:

sample (DelayedSample) – a sample of a dataset :vizu_epochs: open an interactive plot of misclassified epochs

Return_well_classified:

If True, return well classified epochs instead of misclassified

Return type:

tuple[Figure, dict[str, ndarray]]

Returns:

a figure and a dictionary of the misclassified epochs