---
title: "init(_:labels:)"
framework: createmlcomponents
role: symbol
role_heading: Initializer
path: "createmlcomponents/classificationmetrics/init(_:labels:)"
---

# init(_:labels:)

Creates classification metrics for a sequence of predicted and ground truth label pairs.

## Declaration

```swift
init(_ pairs: some Sequence<(predicted: Label, label: Label)>, labels: Set<Label>)
```

## Parameters

- `pairs`: A sequence of predicted and true label pairs.
- `labels`: The set of labels to consider.

## See Also

### Creating the distribution

- [init(_:_:)](createmlcomponents/classificationmetrics/init(_:_:).md)
- [init()](createmlcomponents/classificationmetrics/init().md)
- [init(_:)](createmlcomponents/classificationmetrics/init(_:).md)
- [init(predicted:groundTruth:labels:)](createmlcomponents/classificationmetrics/init(predicted:groundtruth:labels:).md)
