Jaccard similarity with a length-ratio guard:
min(jaccard, min(len)/max(len)).
Plain Jaccard on run-length-encoded shape vectors can be diluted: padding
both vectors with a long shared run keeps Jaccard high even when one side
has injected content. The length-ratio term keeps the score bounded by how
differently sized the two structures are.
Jaccard similarity with a length-ratio guard:
min(jaccard, min(len)/max(len)).Plain Jaccard on run-length-encoded shape vectors can be diluted: padding both vectors with a long shared run keeps Jaccard high even when one side has injected content. The length-ratio term keeps the score bounded by how differently sized the two structures are.