Skip to content

Main content

Confusion Group Table Sum

Explicit nonnegative square confusion table with unique supplied labels, actual rows and predicted columns; sum aligned explicit subgroup confusion observations by group, preserving one output table per exact group name; no hidden label-axis alignment.

Loading tool…

Description

Sum aligned explicit subgroup confusion observations by group, preserving one output table per exact group name; no hidden label-axis alignment.

A confusion table uses actual labels as rows and predicted labels as columns. Cells can contain occurrence counts or supplied nonnegative weights; the axis label order must stay with the matrix. Row, column and joint normalization have different denominators, and a zero denominator needs an explicit undefined result.

Sum aligned explicit subgroup confusion observations by group, preserving one output table per exact group name; no hidden label-axis alignment.

When to use this tool

Use this tool to sum aligned explicit subgroup confusion observations by group, preserving one output table per exact group name; no hidden label-axis alignment.

How to use the tool and how it works

  1. Enter groupsJson, labels using the input definitions below. Serialize the JSON text fields in the decoded shape shown below.
  2. Run the operation. Resolve malformed-input errors before interpreting the result.
  3. Read result.groups. Interpret signs, units, ordering and null values using the rules below.

Validate every supplied {group,matrix} record against the same square label axes. Group exact names in first-appearance order and sum aligned cells within each group.1

Input fieldMeaning and unitsAccepted input
groupsJsonJSON array of {group, matrix} records. group is a string; every nonnegative square matrix uses the same supplied label order.Text, at most 8,192 UTF-16 code units; the stated grammar and narrower limits also apply.
labelsDistinct label strings defining actual row and predicted column order; score tools require at least one label.Dense list of at most 128 strings, each at most 8,192 UTF-16 code units.

These decoded examples show the structure of the JSON text fields. Supply each as its corresponding serialized JSON string.

json
{
  "groupsJson": [
    {
      "group": "x",
      "matrix": [
        [
          2,
          1
        ],
        [
          0,
          1
        ]
      ]
    },
    {
      "group": "x",
      "matrix": [
        [
          2,
          1
        ],
        [
          0,
          1
        ]
      ]
    }
  ]
}
Output fieldInterpretation
resultObject containing the fields below.
result.groupsFirst-seen exact group names with summed aligned matrices.
json
{
  "input": {
    "groupsJson": "[{\"group\": \"x\", \"matrix\": [[2, 1], [0, 1]]}, {\"group\": \"x\", \"matrix\": [[2, 1], [0, 1]]}]",
    "labels": [
      "a",
      "b"
    ]
  },
  "output": {
    "result": {
      "groups": [
        {
          "group": "x",
          "matrix": [
            [
              4,
              2
            ],
            [
              0,
              2
            ]
          ]
        }
      ]
    }
  }
}

Limitations and assumptions

  • All matrices must already use the same axis order; hidden label alignment, weighting and disjointness of subgroup observations are not checked.
  • Label strings are compared exactly. Confusion values may be nonnegative fractional weights; a count interpretation requires count data. Probability-like score rows use [0,1] entries with sum tolerance 10⁻⁸, without establishing calibration.
  • Every declared top-level input is required and unknown fields are rejected. Ordinary strings are limited to 8,192 UTF-16 code units and lists to 128 entries, with tighter operation-specific bounds where stated. JSON text has bounded nesting and node counts.
  • Numeric outputs must be finite and within the absolute safe-integer magnitude; exact larger integers use decimal text. Source positions are zero-based UTF-16 offsets and span ends are exclusive unless a different convention is explicitly stated.

Alternative or Complementary methods

Check label coverage and axis order before comparing tables. Use a separate evaluation design for uncertainty, calibration, operating thresholds and the consequences of real-world decisions.

References

  1. Tool behavior and example: Confusion Group Table Sum — tool.io

Similar or alternative tools