promptdojo_

Write confusion_matrix(cases). Each case is a dict with predicted and actual keys (values are "fraud" or "legit"). Return a dict with the four counts in this order: tp, fp, tn, fn, where "fraud" is the positive class.

  • tp: predicted fraud, actual fraud
  • fp: predicted fraud, actual legit
  • tn: predicted legit, actual legit
  • fn: predicted legit, actual fraud

full-screen editor opens — close anytime to keep reading.