Skip to content

Honor the custom hash function in hashed() - #274

Open
lllleolin-max wants to merge 2 commits into
matthewwardrop:mainfrom
lllleolin-max:codex/honor-custom-feature-hashes
Open

lllleolin-max wants to merge 2 commits into
matthewwardrop:mainfrom
lllleolin-max:codex/honor-custom-feature-hashes

Conversation

@lllleolin-max

Copy link
Copy Markdown

The documented hash_func argument to hashed() is ignored: the transform always calls MD5. This silently assigns features to the wrong buckets when callers provide a hash function to match an existing feature space. Use the supplied callable and verify both bucket values and end-to-end model matrix encoding, including Python integers larger than int64.

Validation: the added regression tests fail on main (81e675b) and pass with this patch. Related tests: python -m pytest tests/transforms/test_hashed.py -q. Changed files pass ruff check and ruff format.

This branch has not been deployed

No deployments
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.

1 participant