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.
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.pyfind_threshold_max_recall_min_precision(y_true, y_prob, min_precision=0.25).src/pepseqpred/core/train/threshold.pysrc/pepseqpred/core/predict/inference.pyvotes_needed = n_members // 2 + 1.Why this can hurt:
Planning direction: