Skip to content

Main content

Classification: Ordinal Step Error Distance Tool

Measure signed and absolute ordinal class-index error under an explicitly supplied ordered class count.

Loading tool…

Description

Return signed and absolute ordinal class-index errors.

Ordinal labels have an order, but adjacent categories need not be equally spaced measurements. Index distances, cumulative targets and weighted medians preserve a specified ordering while probability normalization, equality at a median boundary and distance costs remain distinct conventions.

Return signed and absolute ordinal class-index errors.

When to use this tool

Use Classification: Ordinal Step Error Distance when evaluating the stated ordered-label target, distance or mass convention.

How to use the tool and how it works

  1. Enter actualIndex, predictedIndex, classCount. 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 result. Expand result to inspect the returned fields.

Return signed and absolute ordinal class-index errors. Require bounded positive whole classCount and actual/predicted indexes in [0,classCount); signedSteps = predicted-actual, absoluteSteps is its magnitude.1

Input fieldMeaning and unitsAccepted input
actualIndexActual IndexRequired. Safe integer. Calculation range: 0 through classCount - 1, inclusive.
predictedIndexPredicted IndexRequired. Safe integer. Calculation range: 0 through classCount - 1, inclusive.
classCountClass CountRequired. Safe integer. Calculation range: 1 through 1000000, inclusive.
Output fieldInterpretationReturned shape
resultReturned calculated value or nested object under the stated output convention.Required. Object.
result.signedStepsSigned StepsCalculated result member: number.
result.absoluteStepsAbsolute StepsCalculated result member: number.
json
{
  "input": {
    "actualIndex": 1,
    "predictedIndex": 3,
    "classCount": 4
  },
  "output": {
    "result": {
      "signedSteps": 2,
      "absoluteSteps": 2
    }
  }
}

Limitations and assumptions

  • Each adjacent index has one unit cost; ordinal labels need not be equal-interval measurements.
  • Outputs are nested inside result. 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 meaningful ordered labels and an appropriate ordinal model; evaluate prediction quality with costs and probability assumptions justified for the actual categories.

References

  1. Calculation and input contract: classification/ordinal-step-error-distance — tool.io

Similar or alternative tools