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

# prediction(from:)

Performs a prediction from a single input.

## Declaration

```swift
func prediction<Label>(from input: Self.Input) async throws -> ClassificationDistribution<Label> where Label : Hashable, Self.Output == ClassificationDistribution<Label>
```

## Parameters

- `input`: The input feature.

## Return Value

Return Value A classification array.

## See Also

### Transforming and predicting

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