10000 DOC Update fit_transform docstring of OneHotEncoder (#12117) · lithuak/scikit-learn@9b470f1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9b470f1

Browse files
albertcthomasjnothman
authored andcommitted
DOC Update fit_transform docstring of OneHotEncoder (scikit-learn#12117)
1 parent acc23c6 commit 9b470f1

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

sklearn/preprocessing/_encoders.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -474,13 +474,17 @@ def _legacy_fit_transform(self, X):
474474
def fit_transform(self, X, y=None):
475475
"""Fit OneHotEncoder to X, then transform X.
476476
477-
Equivalent to self.fit(X).transform(X), but more convenient and more
478-
efficient. See fit for the parameters, transform for the return value.
477+
Equivalent to fit(X).transform(X) but more convenient.
479478
480479
Parameters
481480
----------
482-
X : array-like, shape [n_samples, n_feature]
483-
Input array of type int.
481+
X : array-like, shape [n_samples, n_features]
482+
The data to encode.
483+
484+
Returns
485+
-------
486+
X_out : sparse matrix if sparse=True else a 2-d array
487+
Transformed input.
484488
"""
485489
if self.handle_unknown not in ('error', 'ignore'):
486490
msg = ("handle_unknown should be either 'error' or 'ignore', "

0 commit comments

Comments
 (0)
0