Toggle Menu
Prev Up Next

scikit-learn 1.3.2
Other versions

Please cite us if you use the software.

# `sklearn.utils`.murmurhash3_32

sklearn.utils.murmurhash3_32(key, seed=0, positive=False)

  Compute the 32bit murmurhash3 of key at seed.

  The underlying implementation is MurmurHash3_x86_32 generating low latency 32bits hash suitable for implementing lookup tables, Bloom filters, count min sketch or feature hashing.

  Parameters:
    key np.int32, bytes, unicode or ndarray of dtype=np.int32

      The physical object to hash.

    seed int, default=0

      Integer seed for the hashing algorithm.

    positive bool, default=False
      True: the results is casted to an unsigned int

        from 0 to 2 ** 32 - 1

      False: the results is casted to a signed int

        from -(2 ** 31) to 2 ** 31 - 1