You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Score.score is TypeSafe's expected level: a probability-weighted average that can fall between two levels (e.g. 1.47). Callers who want a level often recompute the most likely one from probabilities:
Deferred during the design of 0.1.0 under "keep TypeSafe names; add aliases or helpers only if they prove worth it".
Goal
Spare callers that recomputation when they want a level rather than an expected value.
Scope
A helper on Score answers returning the most likely level as a member of the declared Levels type.
Design considerations
Name. The package keeps TypeSafe's names for fields (score, confidence, probabilities). A helper is an addition and needs a name that reads apart from TypeSafe's fields (most_likely_level, top_level, mode, ...).
Ties between levels.
Whether a similar helper makes sense for Choice, where choice already is the top option.
Activity