回答編集履歴
1
一部修正
test
CHANGED
@@ -32,15 +32,15 @@
|
|
32
32
|
|
33
33
|
y_true = np.random.randint(0, 2, SIZE)
|
34
34
|
|
35
|
-
y_
|
35
|
+
y_score = np.random.normal(0, 1, SIZE)
|
36
36
|
|
37
|
-
y_pred
|
37
|
+
y_pred = np.where(y_score > 0.5, 1, 0)
|
38
38
|
|
39
|
-
prec.append(precision_score(y_true, y_pred
|
39
|
+
prec.append(precision_score(y_true, y_pred))
|
40
40
|
|
41
|
-
recall.append(recall_score(y_true, y_pred
|
41
|
+
recall.append(recall_score(y_true, y_pred))
|
42
42
|
|
43
|
-
ap.append(average_precision_score(y_true, y_
|
43
|
+
ap.append(average_precision_score(y_true, y_score))
|
44
44
|
|
45
45
|
|
46
46
|
|