Text 0.6.0 minhashpermutations - CyrilB1531/lodestar GitHub Wiki

Lodestar.Text 0.6.0. This page is frozen at that release. Read the current documentation for what main says now. A link to a decision or a migration page follows main, and leaves the archive.

MinHashPermutations

The permutation coefficients a MinHash signature is built from.

public sealed class MinHashPermutations

Example — four permutations, supplied rather than seeded.

using Lodestar.Text.Similarity;

ulong[] multipliers = [3, 5, 7, 11];
ulong[] addends = [13, 17, 19, 23];
var permutations = new MinHashPermutations(multipliers, addends);

int count = permutations.Count;  // => 4
ulong first = permutations.Multiplier(0);  // => 3

Members — one page each.

Member What it does
MinHashPermutations.Multiplier The a coefficient of one permutation
MinHashPermutations.Addend The b coefficient of one permutation

Remarksthe permutations are an input, not a seed. That is the same call decision 0072 made for randomized SVD's Ω, and for the same reason: a randomized algorithm whose randomness is supplied is an ordinary parity target, where one deriving it from a seed would have to reproduce another library's generator stream to agree with it.

datasketch exposes its own pair as MinHash.permutations, so a caller comparing against it passes those; a caller who only needs some permutations can pass any values, and two indexes compared against each other must use the same ones.

Applies to — net10.0, netstandard2.0.

See alsoMinHash, the set-similarity index.