Skip to content

Main content

Categorical Label Probability Lookup

Look up exact label text in an explicit unique-label probability table, using a false flag and zero sentinel for an absent label.

Loading tool…

Description

Look up a categorical probability while distinguishing a missing label.

Probability calculations distinguish event mass, density likelihood, support membership and interval inclusion. Zero likelihood is not always proof of impossibility, and a known zero-probability category differs from an absent label. Independence, disjointness and supplied CDF values are assumptions or records, rather than properties established by local arithmetic.

Look up a categorical probability while distinguishing a missing label.

When to use this tool

Use Categorical Label Probability Lookup when you already have label, labels, probabilities and need to look up a categorical probability while distinguishing a missing label.

How to use the tool and how it works

  1. Enter label, labels, probabilities. Follow any array-alignment requirements below. 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 found, probability. Inspect found before interpreting the associated values.

Require aligned arrays, unique labels and probabilities in [0,1] summing to one within EPSILON*length. Return found and the matching probability, or zero when missing.1

Input fieldMeaning and unitsAccepted input
labelLabelRequired. Text; maximum UTF-16 length 8192.
labelsLabelsRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
probabilitiesProbabilitiesRequired. Array of finite number; maximum items 256.
Output fieldInterpretationReturned shape
foundDistinguishes a present zero-probability label from an absent label with probability=0 placeholder.Required. Boolean.
probabilityProbabilityRequired. Finite number.
json
{
  "input": {
    "label": "B",
    "labels": [
      "A",
      "B"
    ],
    "probabilities": [
      0.25,
      0.75
    ]
  },
  "output": {
    "found": true,
    "probability": 0.75
  }
}

Limitations and assumptions

  • A found zero-probability label differs from found=false; labels are literal and the list is not fitted to observations or renormalized.
  • 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

Use the complete joint model when independence or disjointness cannot be assumed. Evaluate a distribution on its actual support for CDF or likelihood questions, and keep absent categories distinct from explicitly listed zero-probability outcomes.

References

  1. Calculation and input contract: probability/categorical-label-probability-lookup — tool.io

Similar or alternative tools