---
title: "applied(to:eventHandler:)"
framework: createmlcomponents
role: symbol
role_heading: Instance Method
path: "createmlcomponents/onehotencoder/transformer/applied(to:eventhandler:)"
---

# applied(to:eventHandler:)

Performs a one-hot encoding on a single input.

## Declaration

```swift
func applied(to input: Category?, eventHandler: EventHandler? = nil) throws -> [Int]
```

## Return Value

Return Value A one-hot encoded array.

## Discussion

Discussion Parameters input: A category to encode. eventHandler: An event handler.

## See Also

### Performing the transformation

- [applied(_:eventHandler:)](createmlcomponents/onehotencoder/transformer/applied(_:eventhandler:).md)
