skdh.context.PredictGaitLumbarLgbm#
- class skdh.context.PredictGaitLumbarLgbm(downsample_aa_filter=True)#
Process lumbar acceleration data to predict bouts of gait using a Light Gradient Boosted model.
Predictions are computed on non-overlappping 3-second windows.
- Parameters:
- downsample_aa_filterbool, optional
Apply an anti-aliasing filter when downsampling accelerometer data. Default is True.
Methods
convert_timestamps(t)Convert a timestamp/array of timestamps to a datetime object
predict(*, time, accel[, fs])Predict gait bouts.
save_results(results, file_name)Save the results of the processing pipeline to a csv file
- predict(*, time, accel, fs=None)#
Predict gait bouts.
- Parameters:
- timenumpy.ndarray
(N, ) array of unix timestamps, in seconds
- accelnumpy.ndarray
(N, 3) array of accelerations measured by a centrally mounted lumbar inertial measurement device, in units of ‘g’.
- fsfloat, optional
Sampling frequency in Hz of the accelerometer data. If not provided, will be computed form the timestamps.
- Returns:
- gait_boutsnumpy.ndarray
(N, 2) array of indices of the starts (column 1) and stops (column 2) of gait bouts.
- Other Parameters:
- tz_name{None, str}, optional
IANA time-zone name for the recording location if passing in time as UTC timestamps. Can be ignored if passing in naive timestamps.
- Raises:
- LowFrequencyError
If the sampling frequency is less than 20hz.