CustomOperation#

class mobgap.utils.df_operations.CustomOperation(
identifier: Hashable | Sequence | str | None,
function: Callable,
column_name: str | tuple[str, ...] | list[str | tuple[str, ...]],
)[source]#

Metadata for custom aggregations and transformations.

Parameters:
identifier

The data identifier to select the relevant columns from the DataFrame. If None, the entire DataFrame is used. Otherwise, it needs to be a valid loc indexer for the DataFrame (df.loc[:, identifier]).

function

The function to apply. They will get the selected data as first argument. There expected return value depends on the context the CustomOperation is used in.

column_name

The name of the resulting column in the output dataframe. If a list of columns names is provided, the results of the custom function will be spread over multiple columns. For example, if the function returns a tuple of two values, the column names should be a tuple of two strings, if you want the results to be stored in two separate columns. If just a single string is provided, the results will be stored in a single column.

Methods

count(value, /)

Return number of occurrences of value.

index(value[, start, stop])

Return first index of value.

__init__(*args, **kwargs)#
column_name: str | tuple[str, ...] | list[str | tuple[str, ...]]#

Alias for field number 2

count(value, /)#

Return number of occurrences of value.

function: Callable#

Alias for field number 1

identifier: Hashable | Sequence | str | None#

Alias for field number 0

index(value, start=0, stop=sys.maxsize, /)#

Return first index of value.

Raises ValueError if the value is not present.

Examples using mobgap.utils.df_operations.CustomOperation#

Evaluation of final walking bout level DMOs

Evaluation of final walking bout level DMOs

Cadence Evaluation

Cadence Evaluation

Stride Length Evaluation

Stride Length Evaluation

Walking speed estimation

Walking speed estimation

Cadence estimation

Cadence estimation

Stride length estimation

Stride length estimation

Additional Full Pipeline Experiments

Additional Full Pipeline Experiments

Performance of the gait sequences algorithm on the TVS dataset

Performance of the gait sequences algorithm on the TVS dataset

Performance of the initial contact algorithms on the TVS dataset

Performance of the initial contact algorithms on the TVS dataset

Performance of the laterality classification algorithms on the TVS dataset

Performance of the laterality classification algorithms on the TVS dataset

Performance of the cadence algorithms on the TVS dataset

Performance of the cadence algorithms on the TVS dataset

Performance of the stride length algorithms on the TVS dataset

Performance of the stride length algorithms on the TVS dataset