回答編集履歴

1

解決について説明

2018/04/12 09:36

投稿

hayataka2049
hayataka2049

スコア30933

test CHANGED
@@ -5,3 +5,31 @@
5
5
  これは学習と予測を10セットやったという意味ですか? それとも1回学習して10回予測ですか?
6
6
 
7
7
  前者なら、random_state=0を指定してみてください。
8
+
9
+
10
+
11
+ ### 解決について
12
+
13
+ 解決方法:SVCのオプションのrandom_stateを指定したところ、結果が変化しなくなった。
14
+
15
+
16
+
17
+ SVCのオプションのrandom_stateですが、ドキュメントによると
18
+
19
+ > random_state : int, RandomState instance or None, optional (default=None)
20
+
21
+
22
+
23
+ > The seed of the pseudo random number generator to use when shuffling the data. If int, random_state is the seed used by the random number generator; If RandomState instance, random_state is the random number generator; If None, the random number generator is the RandomState instance used by np.random.
24
+
25
+
26
+
27
+ [sklearn.svm.SVC — scikit-learn 0.19.1 documentation ](http://scikit-learn.org/stable/modules/generated/sklearn.svm.SVC.html)
28
+
29
+
30
+
31
+ データのシャッフルに用いているそうです。
32
+
33
+
34
+
35
+ SVMのアルゴリズムで用いているのか、predict_probaで用いる交差検証の際に使われるだけなのかまでは不勉強なのでよくわかりません(でもシャッフルってことは後者?)。