Why Detection Confidence Should Be a Score
Detection systems typically return a device, browser and platform as though each were established. The evidence behind those fields varies widely, and flattening it causes avoidable errors.
Evidence strength differs by field
A browser family inferred from an explicit brand entry rests on much firmer ground than a device model inferred from a fragment inside a comment.
Some fields come from a structured hint the client stated deliberately. Others come from pattern matching against a token whose meaning is conventional.
Returning both as plain strings discards the distinction, and downstream code cannot recover it.
Consumers make different bets
A decision to serve a slightly different image can act on weak evidence, because the cost of being wrong is small.
A decision to serve a platform-specific installer cannot. Being wrong there produces a file that does not run, and a weak inference should route to a chooser instead.
With a single confidence-free answer, both decisions use the same input and one of them is miscalibrated.
Confidence makes unknowns actionable
A low-confidence result is more informative than an unknown, because it carries a best guess along with a warning. Code can use it where the stakes are low and ignore it where they are not.
Reporting benefits similarly. Aggregates can be produced with and without low-confidence rows, which reveals how much of a trend rests on weak classification.
Without the score, weak classifications are indistinguishable from strong ones in every downstream total.
Scoring can be simple
A coarse scale is enough: an exact match on a known string, a family match with an inferred model, and a fallback with structural parsing only.
Finer scales invite false precision. The point is to separate decisions that should act from those that should defer, and three levels does that.
The score should reflect evidence rather than popularity. A common device matched by a general rule is still a general match.
Preserving it through the pipeline
Confidence is usually lost at the first boundary, when a detection result is written to a log or an event as a set of strings.
Carrying one extra field through the pipeline preserves it cheaply, and makes it possible to ask later how much of a dataset was confidently classified.
Systems that keep the score tend to develop better fallbacks, because the weak cases are visible rather than absorbed into the totals.