質問編集履歴
2
提出完了報告
title
CHANGED
File without changes
|
body
CHANGED
@@ -123,4 +123,8 @@
|
|
123
123
|
min_samples_leaf=1, min_samples_split=2,
|
124
124
|
min_weight_fraction_leaf=0.0, n_estimators=10, n_jobs=1,
|
125
125
|
oob_score=False, random_state=None, verbose=0, warm_start=False). Check the list of available parameters with `estimator.get_params().keys()`.
|
126
|
-
```
|
126
|
+
```
|
127
|
+
|
128
|
+
# kaggleのTitanic課題提出まで漕ぎ着けました!
|
129
|
+
[hayataka2049](https://teratail.com/users/hayataka2049) さまのおかげです(*≧∀≦)
|
130
|
+

|
1
`classifier__`削除後のエラー文追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -8,9 +8,9 @@
|
|
8
8
|
- Windows7
|
9
9
|
# 躓いた箇所とエラー文
|
10
10
|
grid_param内の書き方がよくないのだと推測しています。もともとのTitanic課題kernelには`classifier__` はついていなかったのですが、[stackoverflow](https://stackoverflow.com/questions/34889110/random-forest-with-gridsearchcv-error-on-param-grid)を見て`classifier__`をつけることにしました。
|
11
|
+
**↑`classifier__`削除済**
|
11
12
|
|
12
|
-
し
|
13
|
+
削除はしたものの、ExtraTreesClassifierでエラーが出ています。
|
13
|
-
エラー文からは`BaggingClassifier`と`estimator.get_params().keys()`が関係しているように読めるのですが。。。
|
14
14
|
```python
|
15
15
|
#WARNING: Running is very computational intensive and time expensive.
|
16
16
|
grid_n_estimator = [10, 50, 100, 300]
|
@@ -31,68 +31,68 @@
|
|
31
31
|
|
32
32
|
[{
|
33
33
|
'n_estimators': grid_n_estimator,
|
34
|
-
'
|
34
|
+
'max_samples': grid_ratio,
|
35
35
|
'random_state': grid_seed
|
36
36
|
}],
|
37
37
|
|
38
38
|
[{
|
39
39
|
'n_estimators': grid_n_estimator,
|
40
|
-
'
|
40
|
+
'criterion': grid_criterion,
|
41
|
-
'
|
41
|
+
'max_depth': grid_max_depth,
|
42
42
|
'random state': grid_seed
|
43
43
|
}],
|
44
44
|
|
45
45
|
[{
|
46
46
|
'learning_rate': [.05],
|
47
47
|
'n_estimators': [300],
|
48
|
-
'
|
48
|
+
'max_depth': grid_max_depth,
|
49
49
|
'random_state': grid_seed
|
50
50
|
}],
|
51
51
|
|
52
52
|
[{
|
53
53
|
'n_estimators': grid_n_estimator,
|
54
|
-
'
|
54
|
+
'criterion': grid_criterion,
|
55
|
-
'
|
55
|
+
'max_depth': grid_max_depth,
|
56
|
-
'
|
56
|
+
'oob_score': [True],
|
57
57
|
'random_state': grid_seed
|
58
58
|
}],
|
59
59
|
|
60
60
|
[{
|
61
|
-
'
|
61
|
+
'max_iter_predict': grid_n_estimator,
|
62
62
|
'random_state': grid_seed
|
63
63
|
}],
|
64
64
|
|
65
65
|
[{
|
66
|
-
'
|
66
|
+
'fit_intercept': grid_bool,
|
67
|
-
'
|
67
|
+
'solver': ['newton-cg', 'lbfgs', 'liblinear', 'sag', 'saga'],
|
68
68
|
'random_state': grid_seed
|
69
69
|
}],
|
70
70
|
|
71
71
|
[{
|
72
|
-
'
|
72
|
+
'alpha': grid_ratio,
|
73
73
|
}],
|
74
74
|
|
75
75
|
[{}],
|
76
76
|
|
77
77
|
[{
|
78
|
-
'
|
78
|
+
'n_neighbors': [1,2,3,4,5,6,7],
|
79
|
-
'
|
79
|
+
'weights': ['uniform', 'distance'],
|
80
80
|
'algorithm': ['auto', 'ball_tree', 'kd_tree', 'brute']
|
81
81
|
}],
|
82
82
|
|
83
83
|
[{
|
84
|
-
'
|
84
|
+
'C': [1,2,3,4,5],
|
85
|
-
'
|
85
|
+
'gamma': grid_ratio,
|
86
|
-
'
|
86
|
+
'decision_function_shape': ['ovo', 'ovr'],
|
87
|
-
'
|
87
|
+
'probability': [True],
|
88
88
|
'random_state': grid_seed
|
89
89
|
}],
|
90
90
|
|
91
91
|
[{
|
92
92
|
'learning_rate': grid_learn,
|
93
|
-
'
|
93
|
+
'max_depth': [1,2,4,6,8,10],
|
94
94
|
'n_estimators': grid_n_estimator,
|
95
|
-
'
|
95
|
+
'seed': grid_seed
|
96
96
|
}]
|
97
97
|
]
|
98
98
|
|
@@ -114,11 +114,13 @@
|
|
114
114
|
print('-' *10)
|
115
115
|
```
|
116
116
|
|
117
|
-
**エラー文**
|
117
|
+
**`classifier__`削除後のエラー文**
|
118
118
|
|
119
119
|
```
|
120
|
-
ValueError: Invalid parameter
|
120
|
+
ValueError: Invalid parameter random state for estimator ExtraTreesClassifier(bootstrap=False, class_weight=None, criterion='gini',
|
121
|
-
|
121
|
+
max_depth=2, max_features='auto', max_leaf_nodes=None,
|
122
|
+
min_impurity_decrease=0.0, min_impurity_split=None,
|
123
|
+
min_samples_leaf=1, min_samples_split=2,
|
122
|
-
|
124
|
+
min_weight_fraction_leaf=0.0, n_estimators=10, n_jobs=1,
|
123
|
-
|
125
|
+
oob_score=False, random_state=None, verbose=0, warm_start=False). Check the list of available parameters with `estimator.get_params().keys()`.
|
124
126
|
```
|