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.StrideSelectionalgorithm 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.
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( ) bool[source]#
Check if the interval meets the criteria.
- Parameters:
- intervalpd.Series
The interval to check. The interval must at least have a
startandendcolumn 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
startandendvalues to seconds, assuming that they are in samples. If this is not the case and the value are already in seconds,sampling_rate_hzshould set to 1.
- check_multiple( ) Series[source]#
Check if the intervals meet the criteria.
- Parameters:
- intervalspd.DataFrame
The intervals to check. The intervals must at least have a
startandendcolumn 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
startandendvalues to seconds, assuming that they are in samples. If this is not the case and the value are already in seconds,sampling_rate_hzshould 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.