Accuracy is useless the moment one class is rare: predict "not fraud" for everything and you are 99.8% accurate and completely worthless. Precision and recall are what replace it, and writing them once fixes which is which for good.
Write precision_recall_f1(y_true, y_pred) returning the tuple (precision, recall, f1). Both inputs are 0/1 arrays of the same length, and 1 is the positive class.
$$\text{precision} = \frac{TP}{TP + FP} \qquad \text{recall} = \frac{TP}{TP + FN} \qquad F_1 = \frac{2 \cdot P \cdot R}{P + R}$$
You have read the opening. The rest is free with a Bezen account, and no card is needed.
Behind the sign-in