Skip to content

[MRG] CLN: remove duplicate validation of X in Encoders transform#13347

Merged
jorisvandenbossche merged 2 commits intoscikit-learn:masterfrom
jorisvandenbossche:encoders-transform-clean
Mar 2, 2019
Merged

[MRG] CLN: remove duplicate validation of X in Encoders transform#13347
jorisvandenbossche merged 2 commits intoscikit-learn:masterfrom
jorisvandenbossche:encoders-transform-clean

Conversation

@jorisvandenbossche
Copy link
Copy Markdown
Member

The self._transform method already calls self._check_X which does this same validation (check_array) of X, so it should not be needed here (and confirmed by by the passing tests).

This also prevented actually handling the DataFrame column by column on transform (#13253), but this is difficult to test now since both numpy and python encoding methods result in the same.

Copy link
Copy Markdown
Member

@GaelVaroquaux GaelVaroquaux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, aside from the request for a comment.

X = X_temp

n_samples, n_features = X.shape

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be useful to add a comment saying that input validation is done in self._transform

@jorisvandenbossche jorisvandenbossche merged commit afd4321 into scikit-learn:master Mar 2, 2019
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
koenvandevelde pushed a commit to koenvandevelde/scikit-learn that referenced this pull request Jul 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants