TypeSafe.ChoiceAnswer (typesafe_ex v0.1.0)

Copy Markdown View Source

The answer to a TypeSafe.Choice.

  • choice - the most probable option, with the same key (atom or string) the question used
  • probabilities - every option mapped to its probability; they sum to 1
  • confidence - how concentrated the distribution is, from 0 to 1. It is not the probability that the choice is right.

Summary

Functions

The options with their probabilities, most probable first.

Types

t()

@type t() :: %TypeSafe.ChoiceAnswer{
  choice: TypeSafe.Choice.option(),
  confidence: float(),
  probabilities: %{required(TypeSafe.Choice.option()) => float()}
}

Functions

ranked(choice_answer)

@spec ranked(t()) :: [{TypeSafe.Choice.option(), float()}]

The options with their probabilities, most probable first.