Skip to content

Main content

Tversky Alpha Beta Swap Gap Tool

Compare swapping the asymmetry weights of one supplied Tversky overlap.

Loading tool…

Description

Compare swapping the asymmetry weights of one supplied Tversky overlap.

A similarity term depends on the comparison universe, missing-value policy, treatment of repeated features, and normalization. A score can also have a caller-selected value when its mathematical denominator vanishes. Those conventions matter before interpreting a threshold or comparing methods.

Compare swapping the asymmetry weights of one supplied Tversky overlap.

When to use this tool

Use Tversky Alpha Beta Swap Gap when you need this particular comparison term, normalization, domain condition, or empty-result policy in a larger matching workflow.

How to use the tool and how it works

  1. Enter intersection, firstOnly, secondOnly, alpha, beta. 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 forward, swapped, gap. Use the output convention below.

Calculate forward with alpha*firstOnly+beta*secondOnly and swapped with beta*firstOnly+alpha*secondOnly, then gap=forward-swapped. Require nonnegative inputs and both denominators positive.1

Input fieldMeaning and unitsAccepted input
intersectionIntersectionRequired. Finite number; minimum 0.
firstOnlyFirst OnlyRequired. Finite number; minimum 0.
secondOnlySecond OnlyRequired. Finite number; minimum 0.
alphaAlphaRequired. Finite number; minimum 0.
betaBetaRequired. Finite number; minimum 0.
Output fieldInterpretationReturned shape
forwardForwardRequired. Finite number.
swappedSwappedRequired. Finite number.
gapGapRequired. Finite number.
json
{
  "input": {
    "intersection": 2,
    "firstOnly": 1,
    "secondOnly": 3,
    "alpha": 1,
    "beta": 2
  },
  "output": {
    "forward": 0.2222222222222222,
    "swapped": 0.2857142857142857,
    "gap": -0.06349206349206349
  }
}

Limitations and assumptions

  • Only penalties are exchanged while feature-side counts stay fixed. This differs from reversing sets together with penalties and does not establish a symmetric metric.
  • The field tables state structural bounds; the mechanics also specify cross-field constraints. Malformed inputs and unsupported domains cause errors. A successful false flag, empty branch value, or zero placeholder has the meaning stated above and is distinct from an input error.
  • 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. Signed zero is exported as zero.

Alternative or Complementary methods

Compare methods only after aligning feature definitions, missingness, empty policies, multiplicities, and normalizers. Use a complete comparison when the tool returns only one contribution or count check.

References

  1. Calculation and input contract: similarity/tversky-alpha-beta-swap-gap — tool.io

Similar or alternative tools

  • Tversky Parameter Swap Duality

    Calculate intersection/(intersection+alpha*leftOnly+beta*rightOnly) and return that value as both forward and reverseWithSwappedWeights.

  • Tversky One Sided Penalty Parameter

    Calculate Tversky score and alphaDerivative=-intersection*firstOnly/denominator² from denominator=intersection+alpha*firstOnly+beta*secondOnly.