TypeSafe.ScoreAnswer (typesafe_ex v0.1.0)

Copy Markdown View Source

The answer to a TypeSafe.Score.

  • score - the probability-weighted level index; with four levels it lies between 0 and 3 and can fall between levels
  • legend - each level index mapped to the description the question gave it
  • probabilities - each level index mapped to its probability
  • confidence - how concentrated the distribution is, from 0 to 1

Use score to compare against thresholds, not to recover an exact quantity between two levels.

Summary

Functions

The index of the most probable level.

The score scaled to 0..1, where 0 is the first level and 1 the last.

Types

t()

@type t() :: %TypeSafe.ScoreAnswer{
  confidence: float(),
  legend: %{required(non_neg_integer()) => TypeSafe.json()},
  probabilities: %{required(non_neg_integer()) => float()},
  score: float()
}

Functions

level(score_answer)

@spec level(t()) :: non_neg_integer()

The index of the most probable level.

normalized(score_answer)

@spec normalized(t()) :: float()

The score scaled to 0..1, where 0 is the first level and 1 the last.