Magika.Prediction (Magika v0.1.0-rc.0)

Copy Markdown View Source

The outcome of identifying a single input.

Fields:

  • :output — the Magika.ContentTypeInfo Magika returns to the user. This accounts for confidence thresholds and the overwrite map.
  • :dl — the Magika.ContentTypeInfo of the raw deep-learning model prediction. For inputs handled without the model (empty files, very small files, directories, symlinks) this is the special undefined type.
  • :score — the model's confidence for :dl in [0.0, 1.0]. For inputs handled without the model this is 1.0.
  • :overwrite_reason — why :output differs from :dl, one of :none, :low_confidence, :overwrite_map.

Summary

Types

overwrite_reason()

@type overwrite_reason() :: :none | :low_confidence | :overwrite_map

t()

@type t() :: %Magika.Prediction{
  dl: Magika.ContentTypeInfo.t(),
  output: Magika.ContentTypeInfo.t(),
  overwrite_reason: overwrite_reason(),
  score: float()
}