gaitmap.evaluation_utils.recall_score#

gaitmap.evaluation_utils.recall_score(matches_df: dict[Union[collections.abc.Hashable, str], pandas.core.frame.DataFrame], *, zero_division: typing_extensions.Literal[warn, 0, 1] = 'warn') dict[Union[collections.abc.Hashable, str], float][source]#
gaitmap.evaluation_utils.recall_score(matches_df: DataFrame, *, zero_division: typing_extensions.Literal[warn, 0, 1] = 'warn') float

Compute the recall.

The recall is the ratio tp / (tp + fn) where tp is the number of true positives and fn the number of false negatives. The recall is intuitively the ability of the classifier to find all the positive samples.

The best value is 1 and the worst value is 0.

Parameters:
matches_df

A 3 column dataframe with the column names s_id{stride_list_postfix}, s_id{ground_truth_postfix} and match_type or a dictionary of such dataframes. Each row is a match containing the index value of the left and the corresponding right one. The match_type column indicates the type of match: “tp” (true positive), “fp” (false positives) or “fn” (false negative) if no segmented counterpart exists.

zero_division“warn”, 0 or 1, default=”warn”

Sets the value to return when there is a zero division. If set to “warn”, this acts as 0, but warnings are also raised.

Returns:
recall_score

This is a float, if the input is just a single dataframe or a dictionary, if the input is a dictionary of dataframes.

See also

gaitmap.evaluation_utils.evaluate_segmented_stride_list

Generate matched_df from stride lists