PY
py
1
2
3
4
5
6
7
8
9
10
11
import numpy as np
from sklearn.metrics import confusion_matrix as cm
y_true = [int(x) for x in input().split()]
y_pred = [int(x) for x in input().split()]
#The Solution
yt=np.array(y_true)
yp=np.array(y_pred)
print(cm(yp,yt,labels=[True,False]).astype(float))
#Rows become predicted class, and columns become actual class.
#Labeling starts with True.
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run