Skip to content

Post-hoc control recall counts undefined no-control samples after parse failures #1799

Description

@sylvesterkaczmarek

Describe the bug

compute_ctrl_recall_posthoc() documents that samples with no control variables in the gold label are skipped because recall is undefined.

That happens when solver output parses successfully, because compute_recall(..., set()) returns NaN. But if the same sample has malformed solver output, preds becomes None and the function instead sets:

recall = 0

So a sample that should always be excluded from the average is counted as a zero only when parsing fails, which can incorrectly lower the reported post-hoc control recall.

Expected behavior

Samples whose gold hypothesis is invalid, or whose valid gold hypothesis contains no control variables, should be skipped consistently regardless of solver-output parse success.

Proposed fix

Check the gold-label applicability before handling predictions, return NaN for no-control samples, and add regression coverage combining an undefined malformed sample with a normal valid recall sample.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions