<!--
{
  "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 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateMLComponents",
  "identifier" : "/documentation/CreateMLComponents/ClassificationMetrics/add(predicted:groundTruth:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Create ML Components"
    ],
    "preciseIdentifier" : "s:18CreateMLComponents21ClassificationMetricsV3add9predicted11groundTruthyqd___qd_0_t7ElementQyd__RszSTRd__STRd_0_AGQyd_0_AHRSr0_lF"
  },
  "title" : "add(predicted:groundTruth:)"
}
-->

# add(predicted:groundTruth:)

Updates the metrics with more predicted and ground truth labels.

```
mutating func add(predicted: some Sequence<Label>, groundTruth: some Sequence<Label>)
```

## Parameters

`predicted`

The predicted labels.

`groundTruth`

The true labels.

## Discussion

The predicted and ground truth sequences are matched element by element in the order they are provided. Both
sequences must have the same number of elements.

---

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)