回答編集履歴

1

一部修正

2021/01/30 13:04

投稿

toast-uz
toast-uz

スコア3266

test CHANGED
@@ -32,15 +32,15 @@
32
32
 
33
33
  y_true = np.random.randint(0, 2, SIZE)
34
34
 
35
- y_pred = np.random.normal(0, 1, SIZE)
35
+ y_score = np.random.normal(0, 1, SIZE)
36
36
 
37
- y_pred_binary = np.where(y_pred > 0.5, 1, 0)
37
+ y_pred = np.where(y_score > 0.5, 1, 0)
38
38
 
39
- prec.append(precision_score(y_true, y_pred_binary))
39
+ prec.append(precision_score(y_true, y_pred))
40
40
 
41
- recall.append(recall_score(y_true, y_pred_binary))
41
+ recall.append(recall_score(y_true, y_pred))
42
42
 
43
- ap.append(average_precision_score(y_true, y_pred))
43
+ ap.append(average_precision_score(y_true, y_score))
44
44
 
45
45
 
46
46