Recall Gap Between Groups

~8 mincode completion

Implement recall_gap(cm_a, cm_b) returning the array [recall_a, recall_b, gap]. Each group has at least one real positive.

Where this shows up

~8 min

8 employers weight this skill

3 AI product companies, 2 frontier labs, 1 health and bio company, 1 big tech firm, 1 autonomy company. Top match scores 93.

Python
import numpy as np


def recall_gap(cm_a, cm_b):
    """
    Recall of each group and the signed gap between them.

    Args:
        cm_a: 2x2 confusion matrix [[TN, FP], [FN, TP]] for group A
        cm_b: 2x2 confusion matrix [[TN, FP], [FN, TP]] for group B

    Returns:
        array [recall_a, recall_b, recall_a - recall_b]
    """
    # YOUR CODE HERE
    pass
Loading docs…

The AI Mentor needs an account

It reads your code and the failing tests and nudges you toward the fix without handing you the answer. Free accounts get it on every problem you're working on today.