Skip to content

Plotting#

Plot helpers shared by notebooks.

Functions:

Name Description
plot_history

Plot training/validation accuracy and loss curves.

plot_channel_class_average

Plot the class-average signal for one EEG channel.

plot_history #

plot_history(
    history: dict[str, list[float]], title: str
) -> Any

Plot training/validation accuracy and loss curves.

Parameters:

Name Type Description Default
history dict[str, list[float]]

Keras-like history dictionary with accuracy/loss lists.

required
title str

Prefix used in subplot titles.

required

Returns:

Type Description
Any

Matplotlib figure containing accuracy and loss subplots.

plot_channel_class_average #

plot_channel_class_average(
    X: ndarray, y: ndarray, channel: int = 8
) -> Any

Plot the class-average signal for one EEG channel.

Parameters:

Name Type Description Default
X ndarray

EEG trials shaped (trials, channels, time).

required
y ndarray

Raw BCI cue labels 769-772.

required
channel int

Channel index to visualize.

8

Returns:

Type Description
Any

Matplotlib figure with one line per class.