Skip to content

Main content

Ranked Prefix Overlap Depth Tool

Measure overlap at a positive common prefix depth in two rankings with unique exact string identifiers.

Loading tool…

Description

Intersect their first-depth sets and divide overlapCount by depth.

Ranking metrics compare order or discount relevance by position. Ties, one-based ranks, and normalization choices change the contribution of an individual pair or rank.

Intersect their first-depth sets and divide overlapCount by depth.

When to use this tool

Use Ranked Prefix Overlap Depth when you need one rank discount, tie block, or pairwise contribution.

How to use the tool and how it works

  1. Enter firstRanking, secondRanking, depth. Keep parallel arrays aligned. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read overlapCount, overlapFraction. Use the output convention below.

Require unique IDs throughout both rankings and a positive depth within both lengths. Intersect their first-depth sets and divide overlapCount by depth.1

Input fieldMeaning and unitsAccepted input
firstRankingFirst RankingRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
secondRankingSecond RankingRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
depthDepthRequired. Safe integer; minimum 1.
Output fieldInterpretationReturned shape
overlapCountOverlap CountRequired. Safe integer.
overlapFractionOverlap FractionRequired. Finite number.
json
{
  "input": {
    "firstRanking": [
      "a",
      "b",
      "c"
    ],
    "secondRanking": [
      "b",
      "d",
      "a"
    ],
    "depth": 2
  },
  "output": {
    "overlapCount": 1,
    "overlapFraction": 0.5
  }
}

Limitations and assumptions

  • This measures shared membership rather than agreement of ordering within the prefixes; ties and missing IDs must be resolved beforehand.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Evaluate the full ranked set with a documented gain transformation, tie convention, and normalization.

References

  1. Calculation and input contract: similarity/ranked-prefix-overlap-depth — tool.io

Similar or alternative tools