質問編集履歴

2

提出完了報告

2018/09/12 03:37

投稿

Yukiya025
Yukiya025

スコア86

test CHANGED
File without changes
test CHANGED
@@ -249,3 +249,11 @@
249
249
  oob_score=False, random_state=None, verbose=0, warm_start=False). Check the list of available parameters with `estimator.get_params().keys()`.
250
250
 
251
251
  ```
252
+
253
+
254
+
255
+ # kaggleのTitanic課題提出まで漕ぎ着けました!
256
+
257
+ [hayataka2049](https://teratail.com/users/hayataka2049) さまのおかげです(*≧∀≦)
258
+
259
+ ![Titanic Submit](f7627fce2914e4a7fe863a1952635704.png)

1

`classifier__`削除後のエラー文追加

2018/09/12 03:37

投稿

Yukiya025
Yukiya025

スコア86

test CHANGED
File without changes
test CHANGED
@@ -18,11 +18,11 @@
18
18
 
19
19
  grid_param内の書き方がよくないのだと推測しています。もともとのTitanic課題kernelには`classifier__` はついていなかったのですが、[stackoverflow](https://stackoverflow.com/questions/34889110/random-forest-with-gridsearchcv-error-on-param-grid)を見て`classifier__`をつけることにしました。
20
20
 
21
-
21
+ **↑`classifier__`削除済**
22
-
22
+
23
+
24
+
23
- かし`BaggingClassifier`に関し、どう修正べきなのかがわかりません(>_<)
25
+ 削除はたもののExtraTreesClassifierでエラーが出いま
24
-
25
- エラー文からは`BaggingClassifier`と`estimator.get_params().keys()`が関係しているように読めるのですが。。。
26
26
 
27
27
  ```python
28
28
 
@@ -64,21 +64,21 @@
64
64
 
65
65
  'n_estimators': grid_n_estimator,
66
66
 
67
- 'classifier__max_samples': grid_ratio,
67
+ 'max_samples': grid_ratio,
68
-
68
+
69
- 'random_state': grid_seed
69
+ 'random_state': grid_seed
70
-
70
+
71
- }],
71
+ }],
72
-
73
-
74
-
72
+
73
+
74
+
75
- [{
75
+ [{
76
-
76
+
77
- 'n_estimators': grid_n_estimator,
77
+ 'n_estimators': grid_n_estimator,
78
-
78
+
79
- 'classifier__criterion': grid_criterion,
79
+ 'criterion': grid_criterion,
80
-
80
+
81
- 'classifier__max_depth': grid_max_depth,
81
+ 'max_depth': grid_max_depth,
82
82
 
83
83
  'random state': grid_seed
84
84
 
@@ -92,23 +92,23 @@
92
92
 
93
93
  'n_estimators': [300],
94
94
 
95
- 'classifier__max_depth': grid_max_depth,
95
+ 'max_depth': grid_max_depth,
96
-
96
+
97
- 'random_state': grid_seed
97
+ 'random_state': grid_seed
98
-
98
+
99
- }],
99
+ }],
100
-
101
-
102
-
100
+
101
+
102
+
103
- [{
103
+ [{
104
-
104
+
105
- 'n_estimators': grid_n_estimator,
105
+ 'n_estimators': grid_n_estimator,
106
-
106
+
107
- 'classifier__criterion': grid_criterion,
107
+ 'criterion': grid_criterion,
108
-
108
+
109
- 'classifier__max_depth': grid_max_depth,
109
+ 'max_depth': grid_max_depth,
110
-
110
+
111
- 'classifier__oob_score': [True],
111
+ 'oob_score': [True],
112
112
 
113
113
  'random_state': grid_seed
114
114
 
@@ -118,29 +118,29 @@
118
118
 
119
119
  [{
120
120
 
121
- 'classifier__max_iter_predict': grid_n_estimator,
121
+ 'max_iter_predict': grid_n_estimator,
122
-
122
+
123
- 'random_state': grid_seed
123
+ 'random_state': grid_seed
124
-
124
+
125
- }],
125
+ }],
126
-
127
-
128
-
126
+
127
+
128
+
129
- [{
129
+ [{
130
-
130
+
131
- 'classifier__fit_intercept': grid_bool,
131
+ 'fit_intercept': grid_bool,
132
-
132
+
133
- 'classifier__solver': ['newton-cg', 'lbfgs', 'liblinear', 'sag', 'saga'],
133
+ 'solver': ['newton-cg', 'lbfgs', 'liblinear', 'sag', 'saga'],
134
-
134
+
135
- 'random_state': grid_seed
135
+ 'random_state': grid_seed
136
-
136
+
137
- }],
137
+ }],
138
-
139
-
140
-
138
+
139
+
140
+
141
- [{
141
+ [{
142
-
142
+
143
- 'classifier__alpha': grid_ratio,
143
+ 'alpha': grid_ratio,
144
144
 
145
145
  }],
146
146
 
@@ -152,9 +152,9 @@
152
152
 
153
153
  [{
154
154
 
155
- 'classifier__n_neighbors': [1,2,3,4,5,6,7],
155
+ 'n_neighbors': [1,2,3,4,5,6,7],
156
-
156
+
157
- 'classifier__weights': ['uniform', 'distance'],
157
+ 'weights': ['uniform', 'distance'],
158
158
 
159
159
  'algorithm': ['auto', 'ball_tree', 'kd_tree', 'brute']
160
160
 
@@ -164,13 +164,13 @@
164
164
 
165
165
  [{
166
166
 
167
- 'classifier__C': [1,2,3,4,5],
167
+ 'C': [1,2,3,4,5],
168
-
168
+
169
- 'classifier__gamma': grid_ratio,
169
+ 'gamma': grid_ratio,
170
-
170
+
171
- 'classifier__decision_function_shape': ['ovo', 'ovr'],
171
+ 'decision_function_shape': ['ovo', 'ovr'],
172
-
172
+
173
- 'classifier__probability': [True],
173
+ 'probability': [True],
174
174
 
175
175
  'random_state': grid_seed
176
176
 
@@ -182,11 +182,11 @@
182
182
 
183
183
  'learning_rate': grid_learn,
184
184
 
185
- 'classifier__max_depth': [1,2,4,6,8,10],
185
+ 'max_depth': [1,2,4,6,8,10],
186
-
186
+
187
- 'n_estimators': grid_n_estimator,
187
+ 'n_estimators': grid_n_estimator,
188
-
188
+
189
- 'classifier__seed': grid_seed
189
+ 'seed': grid_seed
190
190
 
191
191
  }]
192
192
 
@@ -230,18 +230,22 @@
230
230
 
231
231
 
232
232
 
233
- **エラー文**
233
+ **`classifier__`削除後のエラー文**
234
234
 
235
235
 
236
236
 
237
237
  ```
238
238
 
239
- ValueError: Invalid parameter classifier for estimator BaggingClassifier(base_estimator=None, bootstrap=True,
239
+ ValueError: Invalid parameter random state for estimator ExtraTreesClassifier(bootstrap=False, class_weight=None, criterion='gini',
240
-
240
+
241
- bootstrap_features=False, max_features=1.0, max_samples=0.25,
241
+ max_depth=2, max_features='auto', max_leaf_nodes=None,
242
+
242
-
243
+ min_impurity_decrease=0.0, min_impurity_split=None,
244
+
245
+ min_samples_leaf=1, min_samples_split=2,
246
+
243
- n_estimators=300, n_jobs=1, oob_score=False, random_state=0,
247
+ min_weight_fraction_leaf=0.0, n_estimators=10, n_jobs=1,
244
-
248
+
245
- verbose=0, warm_start=False). Check the list of available parameters with `estimator.get_params().keys()`.
249
+ oob_score=False, random_state=None, verbose=0, warm_start=False). Check the list of available parameters with `estimator.get_params().keys()`.
246
250
 
247
251
  ```