compute_f1_threshold: Compute optimal threshold for maximum F1 score
Description
Sweeps thresholds between 0 and 1 to find the one that maximizes F1.
Usage
compute_f1_threshold(y_true, y_prob, positive = "Active")
Value
A list with elements:
- threshold
Best probability cutoff.
- best_f1
Maximum F1 score achieved.
Arguments
- y_true
True factor labels.
- y_prob
Predicted probabilities for the positive class.
- positive
Name of the positive class (default "Active").