Skip to content

[MRG] DOC update fit_transform docstring of OneHotEncoder #12117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions sklearn/preprocessing/_encoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,13 +474,17 @@ def _legacy_fit_transform(self, X):
def fit_transform(self, X, y=None):
"""Fit OneHotEncoder to X, then transform X.

Equivalent to self.fit(X).transform(X), but more convenient and more
efficient. See fit for the parameters, transform for the return value.
Equivalent to fit(X).transform(X) but more convenient.

Parameters
----------
X : array-like, shape [n_samples, n_feature]
Input array of type int.
X : array-like, shape [n_samples, n_features]
The data to encode.

Returns
-------
X_out : sparse matrix if sparse=True else a 2-d array
Transformed input.
"""
if self.handle_unknown not in ('error', 'ignore'):
msg = ("handle_unknown should be either 'error' or 'ignore', "
Expand Down