Selected

class Selected constructor(val categoryId: String, val provenance: ModelProvenance, val confidence: Double? = null, distribution: List<CategoryProbability> = emptyList()) : ClassificationResult

A canonical category ID with the evidence the provider reported for it: an optional confidence and an optional distribution over the categories. Nothing is inferred. Confidence is finite and in 0,1, without a calibration guarantee. A distribution has unique category ids, sums to 1 within 1e-6 and includes the selected id. Direct construction cannot check membership in a spec; providers should use ClassificationSpec.selected, and consumers can validate against the spec, which also requires a distribution to cover exactly the spec's categories.

Constructors

Link copied to clipboard
constructor(categoryId: String, provenance: ModelProvenance, confidence: Double? = null, distribution: List<CategoryProbability> = emptyList())

Properties

Link copied to clipboard

the selected category id

Link copied to clipboard
val confidence: Double? = null

the provider's confidence, in 0..1, when reported

Link copied to clipboard

The per-category probabilities the provider reported, in the order given. The list is an unmodifiable copy. JSON leaves out an empty distribution.

Link copied to clipboard

the model that selected it

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String