Skip to content

Main content

Classification: Binary Confusion Positive Label Swap Tool

Swap the designated positive and negative classes in one binary confusion record, preserving actual/predicted roles.

Loading tool…

Description

Relabel a binary confusion table's positive class.

Classifier metrics count particular outcomes on a declared population and positive-label convention. Precision, recall and accepted-only measures use different denominators. A reporting value at an empty denominator is a policy choice, while one cell, derivative or contribution does not constitute a complete performance evaluation.

Relabel a binary confusion table's positive class.

When to use this tool

Use Classification: Binary Confusion Positive Label Swap when checking the stated confusion-count, metric contribution or abstention-denominator convention.

How to use the tool and how it works

  1. Enter truePositive, falsePositive, falseNegative, trueNegative. 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.

Relabel a binary confusion table's positive class. Require bounded nonnegative whole cells; new TP = old TN, new FP = old FN, new FN = old FP, new TN = old TP.1

Input fieldMeaning and unitsAccepted input
truePositiveTrue PositiveRequired. Safe integer. Calculation count range: 0-1000000 inclusive.
falsePositiveFalse PositiveRequired. Safe integer. Calculation count range: 0-1000000 inclusive.
falseNegativeFalse NegativeRequired. Safe integer. Calculation count range: 0-1000000 inclusive.
trueNegativeTrue NegativeRequired. Safe integer. Calculation count range: 0-1000000 inclusive.
Output fieldInterpretationReturned shape
resultReturned calculated value or nested object under the stated output convention.Required. Object.
result.truePositiveTrue PositiveCalculated result member: number.
result.falsePositiveFalse PositiveCalculated result member: number.
result.falseNegativeFalse NegativeCalculated result member: number.
result.trueNegativeTrue NegativeCalculated result member: number.
json
{
  "input": {
    "truePositive": 2,
    "falsePositive": 3,
    "falseNegative": 4,
    "trueNegative": 5
  },
  "output": {
    "result": {
      "truePositive": 5,
      "falsePositive": 4,
      "falseNegative": 3,
      "trueNegative": 2
    }
  }
}

Limitations and assumptions

  • This exchanges positive/negative labels while retaining axis meaning; no actual labels or complete dataset are verified.
  • 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

Evaluate the complete confusion table, relevant class supports and abstention coverage together; use suitable uncertainty and validation methods for conclusions about predictive performance.

References

  1. Calculation and input contract: classification/binary-confusion-positive-label-swap — tool.io

Similar or alternative tools