Skip to content

skrub/minhash-odd-components-minmax

Pack Severity Fix Versions
skrub error none, edit by hand All versions

MinHashEncoder computes min-hash and max-hash pairs when minmax_hash=True, so an odd n_components raises ValueError during fit.

enc = MinHashEncoder(n_components=31, minmax_hash=True)
enc = MinHashEncoder(n_components=32, minmax_hash=True)

Calls to MinHashEncoder that pass minmax_hash=True with an odd integer literal for n_components.

Pass an even integer for n_components when minmax_hash=True, or drop minmax_hash=True.

MinHashEncoder with minmax_hash=True requires an even n_components and raises ValueError at fit time when n_components is odd. Pass an even integer or set minmax_hash=False.

See all rules in the skrub pack.