---
title: "count(predicted:label:)"
framework: createmlcomponents
role: symbol
role_heading: Instance Method
path: "createmlcomponents/classificationmetrics/count(predicted:label:)"
---

# count(predicted:label:)

Returns the number of times a predicted, true label pair appeared in the label collections.

## Declaration

```swift
func count(predicted: Label, label: Label) -> Int
```

## Parameters

- `predicted`: The predicted label.
- `label`: The true label.

## See Also

### Computing and scoring

- [makeConfusionMatrix()](createmlcomponents/classificationmetrics/makeconfusionmatrix().md)
- [precisionScore(label:)](createmlcomponents/classificationmetrics/precisionscore(label:).md)
- [recallScore(label:)](createmlcomponents/classificationmetrics/recallscore(label:).md)
- [count(label:)](createmlcomponents/classificationmetrics/count(label:).md)
- [count(predicted:)](createmlcomponents/classificationmetrics/count(predicted:).md)
- [trueNegativeCount(of:)](createmlcomponents/classificationmetrics/truenegativecount(of:).md)
- [truePositiveCount(of:)](createmlcomponents/classificationmetrics/truepositivecount(of:).md)
- [falseNegativeCount(of:)](createmlcomponents/classificationmetrics/falsenegativecount(of:).md)
- [falsePositiveCount(of:)](createmlcomponents/classificationmetrics/falsepositivecount(of:).md)
- [f1Score(label:)](createmlcomponents/classificationmetrics/f1score(label:).md)
- [mapLabels(_:)](createmlcomponents/classificationmetrics/maplabels(_:).md)
