<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateMLComponents",
  "identifier" : "/documentation/CreateMLComponents/ObjectDetectionMetrics/averageOfAveragePrecisionAtVariedThresholds(predictions:annotations:confidenceThresholds:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Create ML Components"
    ],
    "preciseIdentifier" : "s:18CreateMLComponents22ObjectDetectionMetricsV43averageOfAveragePrecisionAtVariedThresholds11predictions11annotations010confidenceL0SDyxqd__GSaySayAA08DetectedC0VyxGGG_SayAA0cD10AnnotationVyxGGSDyxSfGtSBRd__lF"
  },
  "title" : "averageOfAveragePrecisionAtVariedThresholds(predictions:annotations:confidenceThresholds:)"
}
-->

# averageOfAveragePrecisionAtVariedThresholds(predictions:annotations:confidenceThresholds:)

Calculates average of average precision for all the labels, computed at varied bounding box overlap thresholds.
The overlap thresholds range is from `[0.05, 0.95]` with a stride of `0.05`.

```
func averageOfAveragePrecisionAtVariedThresholds<Scalar>(predictions: [[DetectedObject<Label>]], annotations: [ObjectDetectionAnnotation<Label>], confidenceThresholds: [Label : Float] = [:]) -> [Label : Scalar] where Scalar : BinaryFloatingPoint
```

## Parameters

`predictions`

A list of all the predictions from an object detection model. Each element in the list is a list of predictions from one image.

`annotations`

A list of all the annotations. Each element is an `ObjectDetectionAnnotation` object from one image.

`confidenceThresholds`

Confidence thresholds for each label. The values will always be between 0.0 and 1.0.
If any label does not have a threshold, the `defaultConfidenceThreshold` is used for that label. The default value is `[:]`.

## Return Value

Average of average precision for all the labels, computed at varied bounding box overlap thresholds.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)