Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

categorical_score

Score a categorical distribution using categorical Brier and the ordered ranked rule.

Contract

Probabilities must sum to one; outcome is a zero-based index. Brier is on [0,2]. Use the unnormalized ranked score only when category order has meaning.

Fields

FieldTypeRequired
op"categorical_score"Yes
outcomeintegerYes
probabilitiesarray of ProbabilityYes

This operation needs no existing question or forecast. Use --memory for a calculation-only session.

Request

Send this object on one line. It is expanded below for readability.

{
  "version": 1,
  "id": "example",
  "command": {
    "op": "categorical_score",
    "probabilities": [
      0.3,
      0.7
    ],
    "outcome": 0
  }
}

Response

This response is generated by executing the example against the current binary. Commit timestamps, when present, are shown as <runtime UTC seconds>; the actual protocol returns integer UTC seconds.

{
  "version": 1,
  "id": "example",
  "result": {
    "categorical_brier": 0.9799999999999999,
    "ranked_probability_unnormalized": 0.48999999999999994
  }
}

Verification

The documentation gate executes the setup and request, then checks the following result fields against independently specified expectations:

JSON pointer within resultExpected
/categorical_brier0.98
/ranked_probability_unnormalized0.49

Float comparisons use a 1e-12 tolerance. Request schema validation and cross-record validation still apply. See errors and recovery for failure handling.