Skip to content

Fix handle_missing parameters and standardize input data shape for MinHashEncoder - #210

Merged
alexis-cvetkov merged 9 commits into
skrub-data:masterfrom
alexis-cvetkov:master
Oct 8, 2021
Merged

Fix handle_missing parameters and standardize input data shape for MinHashEncoder#210
alexis-cvetkov merged 9 commits into
skrub-data:masterfrom
alexis-cvetkov:master

Conversation

@alexis-cvetkov

@alexis-cvetkov alexis-cvetkov commented Sep 28, 2021

Copy link
Copy Markdown
Contributor

I have made small modifications to the MinHashEncoder and GapEncoder:

  • In MinHashEncoder, the default parameterhandle_missing="" becomes zero_impute, since we actually do not impute missing values with an empty string. Instead we assign them a encoding vector filled with zeros.
  • Since other encoders take as input data with shape (N_samples, 1) (to be consistent with scikit-learn), I updated the MinHashEncoder to behave in the same way.
  • In GapEncoder, the default parameterhandle_missing="zero_impute" becomes empty_impute, since we impute NaN with an empty string "".

@GaelVaroquaux

Copy link
Copy Markdown
Member

Can you fix the conflicts and update the changelog please.

@GaelVaroquaux GaelVaroquaux added this to the 0.2.0 release milestone Oct 8, 2021
@alexis-cvetkov alexis-cvetkov changed the title [MinHashEncoder] Fix handle_missing parameter and standardize input data shape [MinHashEncoder & GapEncoder] Fix handle_missing parameter and standardize input data shape Oct 8, 2021
@alexis-cvetkov alexis-cvetkov changed the title [MinHashEncoder & GapEncoder] Fix handle_missing parameter and standardize input data shape Fix handle_missing parameters and standardize input data shape for MinHashEncoder Oct 8, 2021

@LilianBoulard LilianBoulard left a comment

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.

LGTM, thanks for the contributions !

Comment thread dirty_cat/gap_encoder.py Outdated
Comment thread dirty_cat/test/test_minhash_encoder.py Outdated
@alexis-cvetkov

Copy link
Copy Markdown
Contributor Author

Merging !

@alexis-cvetkov
alexis-cvetkov merged commit c206a85 into skrub-data:master Oct 8, 2021
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