biopsykit.sleep.sleep_wake_detection package

Module to perform sleep/wake detection based on Actigraphy or IMU data.

class biopsykit.sleep.sleep_wake_detection.SleepWakeDetection(algorithm_type=None, **kwargs)[source]

Bases: object

General class for sleep/wake detection.

This class provides a generalized interface for sleep/wake detection independent of the used algorithm. When initializing a new instance the algorithm type can be specified.>

Parameters
  • algorithm_type (str, optional) – name of sleep/wake detection algorithm to internally use for sleep/wake detection or None to use default algorithm (Cole/Kripke Algorithm, see ColeKripke for further information)

  • kwargs – optional parameters to be passed to the sleep/wake detection algorithm. The possible parameters depend on the selected sleep/wake detection algorithm and are passed to the respective class.

sleep_wake_algo = None
predict(data, **kwargs)[source]

Apply sleep/wake prediction on input data.

Parameters
  • data (array_like) – input data

  • **kwargs – additional arguments to be passed to the sleep/wake detection algorithm. The possible arguments depend on the individual algorithm.

Returns

dataframe with sleep/wake predictions

Return type

SleepWakeDataFrame