Description
Return winning and runner-up score indexes and margin.
Classification scores rank labels or locate a prediction relative to a chosen decision boundary. Raw scores and logits need not be calibrated probabilities; exact ties, score direction and inclusion of boundary values are separate policy choices that can change the reported decision.
Return winning and runner-up score indexes and margin.
When to use this tool
Use Predicted Class Margin Runner Up when checking the stated score comparison, tie or decision-band policy.
How to use the tool and how it works
- Enter scores. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read winner, runnerUp, margin, tie. Inspect tie before interpreting the associated values.
Return winning and runner-up score indexes and margin. Require at least two scores; sort descending with lower index first at exact ties, margin = winner score-runner-up score, tie means margin zero.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| scores | Scores | Required. Array of finite number; maximum items 256. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| winner | Zero-based maximum-score index, choosing the smaller index at an exact tie. | Required. Safe integer. |
| runnerUp | Runner Up | Required. Safe integer. |
| margin | Margin | Required. Finite number. |
| tie | Tie | Required. Boolean. |
{
"input": {
"scores": [
0.2,
0.7,
0.4
]
},
"output": {
"winner": 1,
"runnerUp": 2,
"margin": 0.29999999999999993,
"tie": false
}
} Limitations and assumptions
- Indexes are zero-based and scores can be unnormalized; no probabilistic confidence or statistical significance is inferred.
- 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
Use a complete evaluation dataset and an explicit decision policy to assess performance; fit and validate calibration separately when a probability interpretation is required.
References
Similar or alternative tools
- Top Two Score Relative Gap
Return top-two scores and their relative gap.
- Class Recall Minimum Count Margin Tool
Compute class recall minimum count margin from explicit bounded inputs.