CustomErrorAggregations#

class mobgap.pipeline.evaluation.CustomErrorAggregations[source]#

Custom aggregation functions that might be useful in addition to the once provided by pandas (e.g. mean/std).

The functions are designed to work in combination with the apply_aggregations.

Attributes:
icc

Calculate the intraclass correlation coefficient (ICC) for the detected and reference values.

quantiles

Calculate the quantiles of a measure.

loa

Calculate the limits of agreement of a measure.

Methods

icc([reference_col_name, detected_col_name])

Calculate the intraclass correlation coefficient (ICC) for the detected and reference values.

loa([agreement])

Calculate the limits of agreement of a measure.

quantiles([lower, upper])

Calculate the quantiles of a measure.

n_datapoints

__init__(*args, **kwargs)#
icc(
reference_col_name: str = 'reference',
detected_col_name: str = 'detected',
) tuple[float, float][source]#

Calculate the intraclass correlation coefficient (ICC) for the detected and reference values.

Parameters:
df

The DataFrame containing the reference and detected values.

reference_col_name

The identifier of the column containing the reference values.

detected_col_name

The identifier of the column containing the detected values.

Returns:
icc, ci95

A tuple containing the intraclass correlation coefficient (ICC) as first item and the lower and upper bound of its 95% confidence interval (CI95%) as second item.

loa(agreement: float = 1.96) tuple[float, float][source]#

Calculate the limits of agreement of a measure.

Parameters:
series

The Series containing the data column of interest.

agreement

The agreement level for the limits of agreement.

Returns:
loa

The lower and upper limits of agreement as a tuple.

quantiles(
lower: float = 0.05,
upper: float = 0.95,
) tuple[float, float][source]#

Calculate the quantiles of a measure.

Parameters:
series

The Series containing the data column of interest.

lower

The lower quantile to calculate.

upper

The upper quantile to calculate.

Returns:
quantiles

The lower and upper quantiles as a tuple.

Examples using mobgap.pipeline.evaluation.CustomErrorAggregations#

Cadence Evaluation

Cadence Evaluation

Stride Length Evaluation

Stride Length Evaluation