Generates train batches from PSG data to be used by the `train_batches()` function.

write_batches_psg(
  records,
  events,
  batches_path = tempdir(),
  channels = c("C3-M2", "C4-M1", "O1-M2", "E1-M2", "E2-M1", "1-2"),
  resample = 70,
  padding = 1,
  batches_size = 1024,
  verbose = TRUE
)

Arguments

records

Character vector of EDF files paths to be included in the train batches.

events

List of events dataframes containing hypnograms corresponding to EDF records in `records` parameter.

batches_path

Character. Path where batches files will be saved.

channels

Character vector. Channels labels to include in the dataset.

resample

Integer. Sample rate to resample selected signals.

padding

Epochs added before and after each epoch.

batches_size

Number of epochs in each batch file.

verbose

Boolean, display status messages or not.

References

Chambon, S., Galtier, M., Arnal, P., Wainrib, G. and Gramfort, A. (2018) A Deep Learning Architecture for Temporal Sleep Stage Classification Using Multivariate and Multimodal Time Series. IEEE Trans. on Neural Systems and Rehabilitation Engineering 26:(758-769).