回答編集履歴

1

d

2018/11/13 09:52

投稿

tiitoi
tiitoi

スコア21956

test CHANGED
@@ -1,3 +1,61 @@
1
1
  2クラス分類ということは出てきた result は (N, 2) の配列ですよね。
2
2
 
3
3
  その場合、result[i, j] は、X_test[i] のクラス j の確率を表しています。
4
+
5
+
6
+
7
+ ----
8
+
9
+
10
+
11
+ ## 追記
12
+
13
+
14
+
15
+ ```python
16
+
17
+ class Label:
18
+
19
+ a = 0
20
+
21
+ b = 1
22
+
23
+
24
+
25
+ dirpaths = [('a', Label.a), ('b', Label.b)]
26
+
27
+
28
+
29
+ data = []
30
+
31
+ labels = []
32
+
33
+ filepaths = []
34
+
35
+
36
+
37
+ for dirname, label in dirpaths:
38
+
39
+ dirpath = os.path.join('data', 'test', dirname, '*.csv')
40
+
41
+ for csv_path in glob.glob(dirpath):
42
+
43
+ data.append(np.loadtxt(csv_path, delimiter=","))
44
+
45
+ labels.append(label)
46
+
47
+ filepaths.appned(csv_path)
48
+
49
+
50
+
51
+ X_test = np.array(data)
52
+
53
+ Y_test = to_categorical(labels)
54
+
55
+
56
+
57
+ #print('X_test.shape', X_test.shape)
58
+
59
+ #print('Y_test.shape', Y_test.shape)
60
+
61
+ ```