skdh.activity.SignalFeatures#
- class skdh.activity.SignalFeatures(window_minutes=15, window_skip_percentage=0.5, state='wake')#
Compute various signal features on the raw acceleration metric.
- Parameters:
- window_minutesint, optional
Number of minutes for each window. Default is 15.
- window_skip_percentagefloat, optional
Skip percentage of the window. Values between 0 and 1. Default is 0.5. Will be trimmed between 0.01 and 0.99.
- state{‘wake’, ‘sleep’}
State during which the endpoint is being computed.
Methods
predict(results, i, accel_metric, ...)Saves the signal features values.
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)#
Saves the signal features values.
- 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.
- reset_cached()#
Called after all the blocks during the desired state have been run. Can be used to calculate results on all data for the day/state.