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..."

9th May 2021, 7:46 AM
Jari Kovalainen
Jari Kovalainen - avatar
4 Respostas
+ 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'))
14th Sep 2021, 7:37 AM
Brigido bergado jr
Brigido bergado jr - avatar
+ 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])
11th May 2021, 6:52 AM
Apoorva Datir
Apoorva Datir - avatar
+ 1
Please copy my answer and like check
14th Sep 2021, 7:38 AM
Brigido bergado jr
Brigido bergado jr - avatar
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))
22nd Jul 2021, 4:46 AM
Osvaldo Delgado González
Osvaldo Delgado González - avatar