0
Course: Data Science - Classification - Binary Disorder
Explanation: "...Of the two false labels, both were correctly predicted; that is, zero false positive and two true negatives..." Shouldn't it be "...Of the two false labels, both were correctly predicted; that is, zero false NEGATIVE and two true negatives..."
4 Réponses
+ 5
y_true = [int(x) for x in input().split()]
y_pred = [int(x) for x in input().split()]
from sklearn.metrics import confusion_matrix
import numpy as np
cm = confusion_matrix(y_pred, y_true, labels=[1,0])
print(np.array(cm, dtype='f'))
+ 1
here we have to use y_pred first in confusion matrix then y_true to get the result
confusion_matrix( y_pred_arr,y_true_arr, labels=[1,0])
+ 1
Please copy my answer and like check
0
from sklearn.metrics import confusion_matrix
y_true = [int(x) for x in input().split()]
y_pred = [int(x) for x in input().split()]
m = confusion_matrix(y_pred,y_true, labels = [1,0])
print(m.astype(float))