resolve

Close out a prediction with what actually happened. The surprise value (auto-derived if you don't supply one) feeds calibration.

Signature

resolve({
  prediction_id: number,
  outcome: 'correct' | 'incorrect' | 'partial',
  actual: string,
  surprise?: number
}) → { prediction_id: number, outcome: string, surprise: number }
ParamTypeRequiredDescription
prediction_idintyesId of the prediction to resolve.
outcomeenumyescorrect, incorrect, or partial.
actualstringyesWhat actually happened.
surprisenumber 0..1noOverride the derived value.

Example

curl -X POST https://mneva.dev/v1/resolve \
  -H "x-mneva-key: $MNEVA_KEY" \
  -H "content-type: application/json" \
  -d '{
    "prediction_id": 1,
    "outcome": "incorrect",
    "actual": "deploy failed — missing env var"
  }'

Response:

{ "prediction_id": 1, "outcome": "incorrect", "surprise": 0.9 }

The prediction was confidence 0.9 and the outcome was incorrect, so derived surprise is 0.9 — a confident wrong is the loudest possible miss. That fact now feeds every future assess and calibration in the prediction's domain.

A prediction can only be resolved once. Re-calling resolve with the same id returns 404 prediction X is already resolved.

Surprise — derived or supplied

If you don't pass surprise, Mneva derives it from outcome + confidence:

  • correct1 − confidence (low surprise if you expected to be right)
  • incorrectconfidence (high surprise if you were confidently wrong)
  • partial|0.5 − confidence| (modest mismatch)

The derived value is correct most of the time. Override it when you know the surprise was different from what the math implies — for instance, a prediction you'd given confidence 0.4 turned out to be incorrect in an unexpected way; the math says surprise 0.4, but the manner of being wrong might warrant a higher number to feed calibration.

The supplied value is clamped to [0, 1].

See also

Was this page helpful?