Skip to content

Threshold policy is hard-coded and can be overly conservative #82

@jeffreyHoelzel

Description

@jeffreyHoelzel

Training chooses thresholds by maximizing recall subject to minimum precision 0.25. If that precision is unreachable, it falls back to the best precision threshold. Ensemble prediction then uses majority vote on member-thresholded binary masks.

Evidence:

  • src/pepseqpred/core/train/trainer.py
    • Calls find_threshold_max_recall_min_precision(y_true, y_prob, min_precision=0.25).
  • src/pepseqpred/core/train/threshold.py
    • Fallback favors best precision when minimum precision is unreachable.
  • src/pepseqpred/core/predict/inference.py
    • Ensemble prediction thresholds each member independently and uses majority vote.
    • Ties are effectively negative because votes_needed = n_members // 2 + 1.

Why this can hurt:

  • A hard minimum precision can push thresholds high and crush recall on difficult or shifted pathogen groups.
  • Majority vote over conservative masks further reduces positive calls.
  • The reported validation threshold may not transfer to external multi-pathogen evaluation.

Planning direction:

  • Make threshold selection configurable.
  • Evaluate fixed thresholds, best-F1 thresholds, max-MCC thresholds, and recall-target thresholds.
  • For ensembles, compare majority vote with mean-probability thresholding.
  • Report threshold status, selected threshold, predicted positive fraction, and recall by pathogen/family.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions