CustomOperation#
- class mobgap.utils.df_operations.CustomOperation(
- identifier: Hashable | Sequence | str | None,
- function: Callable,
- column_name: str | tuple[str, ...] | list[str | tuple[str, ...]],
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)#
- count(value, /)#
Return number of occurrences of value.
- 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#
Performance of the gait sequences algorithm 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 cadence algorithms on the TVS dataset
Performance of the stride length algorithms on the TVS dataset