A fraud model gives every payment a chance of being fraud. The bank flags a payment when its chance is at or above a threshold it chooses.
Task: write flag_and_score(y_true, chance, threshold) and return [precision, recall], each rounded to 3 decimal places.
y_true holds 1 for fraud and 0 for a normal payment. It contains at least one 1.chance holds the model's chance of fraud for each payment, in the same order.0.0.Try a high and a low threshold on the same payments and watch the two scores pull against each other.