Skip to content

add get_feature_names_out to MinHashEncoder - #616

Merged
jovan-stojanovic merged 6 commits into
skrub-data:mainfrom
LeoGrin:min_hash_encoder_improvements
Jun 26, 2023
Merged

add get_feature_names_out to MinHashEncoder#616
jovan-stojanovic merged 6 commits into
skrub-data:mainfrom
LeoGrin:min_hash_encoder_improvements

Conversation

@LeoGrin

@LeoGrin LeoGrin commented Jun 22, 2023

Copy link
Copy Markdown
Contributor

We generate feature names as feature_name_1_0, ... feature_name_1_n_components etc. If feature names are missing, we use x_0, x_1 etc
(+ a test to check that the MinHashEncoder is deterministic)

@Vincent-Maladiere Vincent-Maladiere 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.

Hey @LeoGrin, thanks for the PR! Hopefully, this will play nicely with TableVectorizer :)

Here are a couple of quick remarks:

Comment thread skrub/tests/test_minhash_encoder.py Outdated
Comment thread skrub/tests/test_minhash_encoder.py Outdated
Comment thread skrub/tests/test_minhash_encoder.py Outdated
Comment thread skrub/tests/test_minhash_encoder.py Outdated
Comment thread skrub/_minhash_encoder.py Outdated
Comment thread skrub/_minhash_encoder.py Outdated
Comment thread skrub/_minhash_encoder.py Outdated
Comment thread skrub/_minhash_encoder.py Outdated
Comment thread skrub/_minhash_encoder.py Outdated
Comment thread skrub/_minhash_encoder.py Outdated
Comment thread skrub/_minhash_encoder.py Outdated
LeoGrin and others added 2 commits June 23, 2023 16:03
replace ` by ``

Co-authored-by: Vincent M <maladiere.vincent@yahoo.fr>
@LeoGrin

LeoGrin commented Jun 23, 2023

Copy link
Copy Markdown
Contributor Author

Thanks for the comments @Vincent-Maladiere !

@Vincent-Maladiere Vincent-Maladiere 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.

Thanks @LeoGrin! LGTM after CI is green :)

@jovan-stojanovic jovan-stojanovic 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.

Thanks Leo! Two minor precision and this is good to be merged

Comment thread skrub/tests/test_minhash_encoder.py Outdated

def test_deterministic():
"""Test that the encoder is deterministic"""
# TODO: add random state to encoder

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.

Is there randomness? If it's deterministic, no need for random state.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Right now it's deterministic because the seed in the hash is fixed, but we could imagine allowing the user to vary the seed.

Co-authored-by: Jovan Stojanovic <62058944+jovan-stojanovic@users.noreply.github.com>
@jovan-stojanovic
jovan-stojanovic merged commit a7e0e41 into skrub-data:main Jun 26, 2023
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.

4 participants