---
title: "prediction(from:eventHandler:)"
framework: createmlcomponents
role: symbol
role_heading: Instance Method
path: "createmlcomponents/transformer/prediction(from:eventhandler:)"
---

# prediction(from:eventHandler:)

Performs a prediction on a sequence of annotated inputs.

## Declaration

```swift
func prediction<S, Annotation>(from input: S, eventHandler: EventHandler? = nil) async throws -> [AnnotatedPrediction<Self.Output, Annotation>] where S : Sequence, S.Element == AnnotatedFeature<Self.Input, Annotation>
```

## Parameters

- `input`: A sequence of annotated inputs.
- `eventHandler`: An event handler.

## Return Value

Return Value Annotated predictions produced by applying the transformer to the inputs.

## See Also

### Transforming and predicting

- [callAsFunction(_:eventHandler:)](createmlcomponents/transformer/callasfunction(_:eventhandler:).md)
- [prediction(from:)](createmlcomponents/transformer/prediction(from:).md)
