sleepless.utils.matplotlib_utils#

Some matplotlib variables.

Functions

get_sleep_stage_labels(y_class)

Filter event dictionary with events code present in a list, this list should only contains, y_label, y_pred (both or only one of them)

loss_graph_xgboost(results)

Classes

PointBrowser(x, y, label, ypred, ...)

sleepless.utils.matplotlib_utils.get_sleep_stage_labels(y_class)[source]#

Filter event dictionary with events code present in a list, this list should only contains, y_label, y_pred (both or only one of them)

Event index must follow the following mapping:

event_dic = {

“Stage W”: 0, “N1”: 1, “N2”: 2, “N3”: 3, “REM”: 4, “Stage ?”: 5, }

Parameters:

y_label – a list of np.ndarray(n_epochs),containing event index.

Return type:

dict[str, int]

class sleepless.utils.matplotlib_utils.PointBrowser(x, y, label, ypred, misclassified_epochs, fig)[source]#

Bases: object

on_press(event)[source]#
on_pick(event)[source]#
update()[source]#
sleepless.utils.matplotlib_utils.loss_graph_xgboost(results)[source]#