A confidence score expresses how strongly a model favors a prediction. Classification models expose class-specific values in logits, while object-detection models return scores for detected objects. section 3.2.3 section 4.2.1
Selecting a sentiment prediction
For the sentence “I loved the movie, it was fantastic!”, the model returns logits [-4.3428, 4.6955]. Applying torch.argmax selects class 1, producing the sentiment label “positive.” section 3.2.3
Confidence appears in several useful model outputs:
- Classification logits contain one value for each class; the larger value indicates the favored class. section 3.2.3
- Object detection returns a score for each detected object alongside its label and bounding box. section 4.2.1
- A threshold can filter detections, such as retaining only predictions above 90 percent confidence. section 4.2.1
Figure 3.13 The confidence score for each class
Use the class-score visualization to compare confidence values before selecting a prediction. section 3.2.3












