In [89]:
# Manually double check the Confusion Matrix values
test = test_y.tolist()
preds = test_predictions.tolist()
manual = manually_calculate_tp_tn_fp_fn(test, preds)

print("\nsklearn cm:", data)
print("Manual:", manual)
if data == manual:
    print("\nThe cm returned from sklearn has been manually confirmed.")
else:
    print("\nSomething went wrong. Recheck the Confusion Matrix.")
sklearn cm: [[573, 120], [212, 1043]]
Manual: [[573, 120], [212, 1043]]

The cm returned from sklearn has been manually confirmed.