BaseIntervalCriteria#

class mobgap.wba.BaseIntervalCriteria[source]#

Base class for all criteria that are used to filter intervals (e.g. strides) based on their parameters.

These criteria can be used in combination with the mobgap.wba.StrideSelection algorithm to filter out strides that do not meet a set of criteria.

Methods

check(interval, *[, sampling_rate_hz])

Check if the interval meets the criteria.

check_multiple(intervals, *[, sampling_rate_hz])

Check if the intervals meet the criteria.

clone()

Create a new instance of the class with all parameters copied over.

get_params([deep])

Get parameters for this algorithm.

requires_columns()

Return a list of columns that are required in the intervals to check.

set_params(**params)

Set the parameters of this Algorithm.

__init__(*args, **kwargs)#
check(
interval: Series,
*,
sampling_rate_hz: float | None = None,
) bool[source]#

Check if the interval meets the criteria.

Parameters:
intervalpd.Series

The interval to check. The interval must at least have a start and end column that contain the start and end of the interval in samples. Additional columns might be used to check the values of further parameters.

sampling_rate_hz

The sampling rate of the data in Hz. This is used to potentially convert the start and end values to seconds, assuming that they are in samples. If this is not the case and the value are already in seconds, sampling_rate_hz should set to 1.

check_multiple(
intervals: DataFrame,
*,
sampling_rate_hz: float | None = None,
) Series[source]#

Check if the intervals meet the criteria.

Parameters:
intervalspd.DataFrame

The intervals to check. The intervals must at least have a start and end column that contain the start and end of the interval in samples. Additional columns might be used to check the values of further parameters.

sampling_rate_hz

The sampling rate of the data in Hz. This is used to potentially convert the start and end values to seconds, assuming that they are in samples. If this is not the case and the value are already in seconds, sampling_rate_hz should set to 1.

Returns:
pd.Series

A boolean series indicating if the intervals meet the criteria.

clone() Self[source]#

Create a new instance of the class with all parameters copied over.

This will create a new instance of the class itself and all nested objects

get_params(deep: bool = True) dict[str, Any][source]#

Get parameters for this algorithm.

Parameters:
deep

Only relevant if object contains nested algorithm objects. If this is the case and deep is True, the params of these nested objects are included in the output using a prefix like nested_object_name__ (Note the two “_” at the end)

Returns:
params

Parameter names mapped to their values.

requires_columns() list[str][source]#

Return a list of columns that are required in the intervals to check.

Returns:
list[str]

A list of column names that are required in the intervals to check.

set_params(**params: Any) Self[source]#

Set the parameters of this Algorithm.

To set parameters of nested objects use nested_object_name__para_name=.

Examples using mobgap.wba.BaseIntervalCriteria#

Assembling WBs

Assembling WBs