A fraud team needs precision of at least 90%. Implement threshold_for_precision(y, scores, target) returning the lowest threshold t (chosen from the scores themselves) such that predicting score >= t as positive has precision >= target, along with the recall at that threshold, as (t, recall).
Lower thresholds give more recall, so the lowest qualifying one is best. If no threshold qualifies, return (None, 0.0).