Skip to content

Main content

Hierarchical Label Depth Error Term Tool

Compute hierarchical label depth error term from explicit bounded inputs.

Loading tool…

Description

Return hierarchical label path distance through a supplied common ancestor.

Multilabel predictions can be compared as literal sets or checked against a supplied hierarchy edge. Subset inclusion, exact set equality and distance through an asserted ancestor answer different questions; a local check need not verify label meaning or the complete hierarchy.

Return hierarchical label path distance through a supplied common ancestor.

When to use this tool

Use Hierarchical Label Depth Error Term when checking the stated label-set or parent/ancestor constraint.

How to use the tool and how it works

  1. Enter actualDepth, predictedDepth, commonAncestorDepth. 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 upward, downward, pathLength. Use the output convention below.

Return hierarchical label path distance through a supplied common ancestor. Require nonnegative whole depths and ancestor depth <= both; upward = actualDepth-ancestor, downward = predictedDepth-ancestor, pathLength sums them.1

Input fieldMeaning and unitsAccepted input
actualDepthActual DepthRequired. Safe integer; minimum 0.
predictedDepthPredicted DepthRequired. Safe integer; minimum 0.
commonAncestorDepthCommon Ancestor DepthRequired. Safe integer; minimum 0.
Output fieldInterpretationReturned shape
upwardUpwardRequired. Safe integer.
downwardDownwardRequired. Safe integer.
pathLengthPath LengthRequired. Safe integer.
json
{
  "input": {
    "actualDepth": 4,
    "predictedDepth": 3,
    "commonAncestorDepth": 2
  },
  "output": {
    "upward": 2,
    "downward": 1,
    "pathLength": 3
  }
}

Limitations and assumptions

  • The ancestor and depths are asserted; no tree, ancestry relation or lowest-common-ancestor computation is verified.
  • 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

Validate the label vocabulary and complete hierarchy, and choose dataset-level set or hierarchical metrics appropriate to the prediction task.

References

  1. Calculation and input contract: classification/hierarchical-label-depth-error-term — tool.io

Similar or alternative tools