function confusion_matrix(predictions, labels):
   tp = count(p == 1 and l == 1 for p, l in zip(predictions, labels))

   fp = count(p == 1 and l == 0 for p, l in zip(predictions, labels))
   fn = count(p == 0 and l == 1 for p, l in zip(predictions, labels))
   tn = count(p == 0 and l == 0 for p, l in zip(predictions, labels))
   return {"true_positive": tp, "false_positive": fp, "false_negative": fn, "true_
 negative": tn}
