TypeSafe.Answer.Score (typesafe_ai v0.1.1)

Copy Markdown View Source

The answer to a question built with TypeSafe.score/2.

  • :score is the probability-weighted level index. For n levels it ranges from 0 through n - 1, and may fall between levels.
  • :probabilities maps string indices such as "0" and "1" to probabilities.
  • :legend maps those same string indices to the service's level descriptions.
  • :confidence is a number from 0 to 1 derived by the service from the distribution, not an application-specific accuracy measurement.

For levels ["Routine", "Today", "Immediately"], a score of 1.4 is between the second and third levels. It is not a percentage or a list index to pass directly to Enum.at/2. Use the distribution and your own thresholds to decide what action to take.

Summary

Types

t()

A score, string-indexed probabilities and legend, and confidence.

Types

t()

@type t() :: %TypeSafe.Answer.Score{
  confidence: number(),
  legend: map(),
  probabilities: map(),
  score: number()
}

A score, string-indexed probabilities and legend, and confidence.