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

# precisionScore(label:)

Computes the precision score for a class label.

## Declaration

```swift
func precisionScore(label: Label) -> Double
```

## Parameters

- `label`: The label to use as true positive.

## Return Value

Return Value The precision score for the given label.

## Discussion

Discussion Precision score is computed as the ratio tp / (tp + fp) where tp is the number of true positives and fp is the number of false positives.

## See Also

### Computing and scoring

- [makeConfusionMatrix()](createmlcomponents/classificationmetrics/makeconfusionmatrix().md)
- [recallScore(label:)](createmlcomponents/classificationmetrics/recallscore(label:).md)
- [count(label:)](createmlcomponents/classificationmetrics/count(label:).md)
- [count(predicted:)](createmlcomponents/classificationmetrics/count(predicted:).md)
- [count(predicted:label:)](createmlcomponents/classificationmetrics/count(predicted:label:).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)
