---
title: "predictionWithConfidence(from:)"
framework: createml
role: symbol
role_heading: Instance Method
path: "createml/mltextclassifier/predictionwithconfidence(from:)"
---

# predictionWithConfidence(from:)

Predicts multiple possible labels and their confidence scores for the specified string.

## Declaration

```swift
func predictionWithConfidence(from text: String) throws -> [String : Double]
```

## Parameters

- `text`: The string to classify.

## Return Value

Return Value A dictionary of label predictions and confidence scores.

## See Also

### Testing a text classifier

- [prediction(from:)](createml/mltextclassifier/prediction(from:).md)
- [predictions(from:)](createml/mltextclassifier/predictions(from:).md)
- [predictionsWithConfidence(from:)](createml/mltextclassifier/predictionswithconfidence(from:).md)
