回答編集履歴
1
edit
test
CHANGED
@@ -3,3 +3,47 @@
|
|
3
3
|
|
4
4
|
|
5
5
|
カテゴリの場合も、小数で割合が出て、それの最大のインデックスを取っているので、同じことをやればいいと思います
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
---
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
```python
|
14
|
+
|
15
|
+
import numpy as np
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
np.random.seed(0)
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
a = np.random.randint(0, 300, size=(10))
|
24
|
+
|
25
|
+
print(a)
|
26
|
+
|
27
|
+
# [172 47 117 192 251 195 9 211 277 242]
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
b = np.round(a, decimals=-1)
|
32
|
+
|
33
|
+
print(b)
|
34
|
+
|
35
|
+
# [170 50 120 190 250 200 10 210 280 240]
|
36
|
+
|
37
|
+
```
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
```python
|
42
|
+
|
43
|
+
new_y = sess.run(....)
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
new_y = np.round(new_y, decimals=-1)
|
48
|
+
|
49
|
+
```
|