---
title: "prediction(from:)"
framework: createml
role: symbol
role_heading: Instance Method
path: "createml/mlimageclassifier/prediction(from:)"
---

# prediction(from:)

Generates a prediction for an image.

## Declaration

```swift
func prediction(from image: CGImage) throws -> String
```

## Parameters

- `image`: The image that you want the model to classify.

## Return Value

Return Value A prediction label for the image.

## See Also

### Testing an image classifier

- [predictions(from:)](createml/mlimageclassifier/predictions(from:).md)
