ScoreAnswer

data class ScoreAnswer(val score: Double, val probabilities: Map<Int, Double>, val legend: Map<Int, JsonElement>, val confidence: Double, val levelCount: Int) : Answer(source)

The answer to a Score: score is the probability-weighted level (Σ level × p), so it can fall between levels. probabilities and legend are keyed by level number; the legend holds the level entries that were sent. levelCount is the number of levels asked about.

Constructors

Link copied to clipboard
constructor(score: Double, probabilities: Map<Int, Double>, legend: Map<Int, JsonElement>, confidence: Double, levelCount: Int)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The level with the highest probability, or nearestLevel when no probabilities were returned.

Link copied to clipboard

score rounded to the nearest level.

Link copied to clipboard

score scaled to 0..1 by the top level number, so Scores with different level counts can be weighted together.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun legendText(level: Int): String?

The level's description when it was sent as plain text, otherwise null.