Skip to content
Novus Examples
json264 B

Confusion Matrix — 3-class (JSON)

The same 3-class confusion matrix as JSON — a labels array plus a nested counts matrix. The structured twin of the CSV, for testing evaluation tooling.

Preview — first 26 linesjson
{
  "labels": [
    "person",
    "car",
    "tree"
  ],
  "matrix": [
    [
      48,
      3,
      1
    ],
    [
      4,
      51,
      2
    ],
    [
      2,
      1,
      44
    ]
  ],
  "layout": "rows=actual, cols=predicted"
}

Specifications

Classes
3
Labels
person, car, tree
Layout
rows = actual, columns = predicted

What is a .json file?

JSON (JavaScript Object Notation) is a lightweight, text-based data-interchange format representing objects, arrays, strings, numbers, booleans, and null. It is language-independent, human-readable, and the dominant format for web APIs and configuration. It requires a single well-formed root value.

How to use this file

Use an example JSON file to test parsers and serializers, schema validation, Unicode and number-precision handling, and API request or response processing.

Code examples

import json

with open("confusion-matrix.json") as f:
    data = json.load(f)
print(type(data), len(data))

Generated by generation/ai_datasets.py. Free for any use, no attribution required — license.