質問編集履歴
2
読みにくさ解消
test
CHANGED
File without changes
|
test
CHANGED
@@ -51,6 +51,8 @@
|
|
51
51
|
201 if warn_on_unknown:
|
52
52
|
|
53
53
|
ValueError: Found unknown categories [0, 0.5] in column 0 during transform
|
54
|
+
|
55
|
+
|
54
56
|
```
|
55
57
|
|
56
58
|
### 該当のソースコード
|
1
誤字訂正
test
CHANGED
File without changes
|
test
CHANGED
@@ -14,14 +14,11 @@
|
|
14
14
|
### 発生している問題・エラーメッセージ
|
15
15
|
|
16
16
|
```
|
17
|
-
|
17
|
+
ValueError Traceback (most recent call last) Cell In[246], line 4 2 y_train = encoder.fit_transform(X_train[['_status']]) 3 y_val = encoder.transform(X_val[['_status']]) ----> 4 y_test = encoder.transform(X_test[['_status']]) File [~/.pyenv/versions/3.11.1/lib/python3.11/site-packages/sklearn/utils/_set_output.py:140][1], in _wrap_method_output..wrapped(self, X, *args, **kwargs) 138 @wraps(f) 139 def wrapped(self, X, *args, **kwargs): --> 140 data_to_wrap = f(self, X, *args, **kwargs) 141 if isinstance(data_to_wrap, tuple): 142 # only wrap the first output for cross decomposition 143 return_tuple = ( 144 _wrap_data_with_container(method, data_to_wrap[0], X, self), 145 *data_to_wrap[1:], 146 ) File [~/.pyenv/versions/3.11.1/lib/python3.11/site-packages/sklearn/preprocessing/_encoders.py:1016][2], in OneHotEncoder.transform(self, X) 1011 # validation of X happens in _check_X called by _transform 1012 warn_on_unknown = self.drop is not None and self.handle_unknown in { 1013 "ignore", 1014 "infrequent_if_exist", 1015 } -> 1016 X_int, X_mask = self._transform(
|
18
18
|
|
19
19
|
...
|
20
20
|
|
21
21
|
--> 199 raise ValueError(msg) 200 else: 201 if warn_on_unknown: ValueError: Found unknown categories [0, 2] in column 0 during transform
|
22
|
-
|
23
|
-
[1]: https://file+.vscode-resource.vscode-cdn.net/Users/130n/Downloads/~/.pyenv/versions/3.11.1/lib/python3.11/site-packages/sklearn/utils/_set_output.py:140
|
24
|
-
[2]: https://file+.vscode-resource.vscode-cdn.net/Users/130n/Downloads/~/.pyenv/versions/3.11.1/lib/python3.11/site-packages/sklearn/preprocessing/_encoders.py:1016
|
25
22
|
|
26
23
|
---------------------------------------------------------------------------
|
27
24
|
ValueError Traceback (most recent call last)
|