回答編集履歴

3

edit

2018/07/05 23:21

投稿

mkgrei
mkgrei

スコア8560

test CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  もともとlogで分布しているものから平均と分散をいじっても正規分布にならないじゃないですか。
12
12
 
13
- モデルに学習させるときに正規分布が必要なので。
13
+ それでも、モデルに学習させるときに正規分布が必要なので、うまい変換を施します
14
14
 
15
15
 
16
16
 

2

edit

2018/07/05 23:21

投稿

mkgrei
mkgrei

スコア8560

test CHANGED
@@ -15,3 +15,43 @@
15
15
 
16
16
 
17
17
  x=e^xの変数変換の末に標準分布になるケースがある、ということなら納得できますか?
18
+
19
+
20
+
21
+ ```python
22
+
23
+ import numpy as np
24
+
25
+ from numpy.random import lognormal
26
+
27
+ import matplotlib.pyplot as plt
28
+
29
+ fig, (ax1, ax2, ax3, ax4) = plt.subplots(4, 1)
30
+
31
+
32
+
33
+ s = lognormal(size=1000)
34
+
35
+ ls = np.log(s)
36
+
37
+ ns = (s - s.mean()) / s.std()
38
+
39
+ nls = (ls - ls.mean()) / ls.std()
40
+
41
+
42
+
43
+ def p(ax, s):
44
+
45
+ ax.hist(s, bins=np.linspace(s.min(), s.max(), 100))
46
+
47
+ p(ax1, s)
48
+
49
+ p(ax2, ns)
50
+
51
+ p(ax3, ls)
52
+
53
+ p(ax4, nls)
54
+
55
+ plt.show()
56
+
57
+ ```

1

edit

2018/07/05 23:20

投稿

mkgrei
mkgrei

スコア8560

test CHANGED
@@ -1,4 +1,6 @@
1
1
  https://www.kaggle.com/yww061851/data-preprocessing
2
+
3
+ http://forums.fast.ai/t/data-pre-processing-for-the-input-having-very-small-values/13656
2
4
 
3
5
 
4
6