skdh.activity.BoutIntensityTime#

class skdh.activity.BoutIntensityTime(level, bout_lengths, bout_criteria, bout_metric, closed_bout, cutpoints=None, state='wake')#

Compute the time spent in bouts of intensity levels.

Parameters:
level{“sed”, “light”, “mod”, “vig”, “MVPA”, “SLPA”}

Level of intensity to compute the total time for.

bout_lengths{list, int}

Lengths of bouts, in minutes.

bout_criteriafloat

Percentage (0-1) of time that must be spent in the bout. See ActivityLevelClassification.

bout_metric{1, 2, 3, 4, 5}

Rules for how a bout is determined. See ActivityLevelClassification for more details.

closed_boutbool

Include all time for a bout or just the time at the intensity level. See ActivityLevelClassification for more details.

cutpoints{str, None}

Cutpoints to use for the thresholding. If None, will use migueles_wrist_adult.

state{‘wake’, ‘sleep’}

State during which the endpoint is being computed.

Methods

predict(results, i, accel_metric, ...)

Compute the time spent in bouts at the specified intensity level.

reset_cached()

Called after all the blocks during the desired state have been run.

predict(results, i, accel_metric, accel_metric_60, epoch_s, epochs_per_min, **kwargs)#

Compute the time spent in bouts at the specified intensity level.

Parameters:
resultsdict

Dictionary containing the initialized results arrays. Keys in results are taken from the names of endpoints.

iint

Index of the day, used to index into individual result arrays, e.g. results[self.name][i] = 5.0

accel_metricnumpy.ndarray

Computed acceleration metric (e.g. ENMO).

accel_metric_60numpy.ndarray

Computed acceleration metric for a 60 second window.

epoch_sint

Duration in seconds of each sample of accel_metric.

epochs_per_minint

Number of epochs per minute.