8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 37b0e66 commit afd4321Copy full SHA for afd4321
sklearn/preprocessing/_encoders.py
@@ -675,16 +675,11 @@ def _legacy_transform(self, X):
675
676
def _transform_new(self, X):
677
"""New implementation assuming categorical input"""
678
- X_temp = check_array(X, dtype=None)
679
- if not hasattr(X, 'dtype') and np.issubdtype(X_temp.dtype, np.str_):
680
- X = check_array(X, dtype=np.object)
681
- else:
682
- X = X_temp
683
-
684
- n_samples, n_features = X.shape
685
+ # validation of X happens in _check_X called by _transform
686
X_int, X_mask = self._transform(X, handle_unknown=self.handle_unknown)
687
+ n_samples, n_features = X_int.shape
+
688
if self.drop is not None:
689
to_drop = self.drop_idx_.reshape(1, -1)
690
0 commit comments