---
title: "update(_:with:eventHandler:)"
framework: createmlcomponents
role: symbol
role_heading: Instance Method
path: "createmlcomponents/ordinalencoder/update(_:with:eventhandler:)"
---

# update(_:with:eventHandler:)

Updates a transformer with a new sequence of examples.

## Declaration

```swift
func update(_ transformer: inout OrdinalEncoder<Category>.Transformer, with input: some Sequence<Optional<Category>>, eventHandler: EventHandler? = nil) throws
```

## Parameters

- `transformer`: A transformer to update.
- `input`: A sequence of examples.
- `eventHandler`: An event handler.

## Discussion

Discussion note: You can’t add new categories on subsequent updates. All categories should be present in the initial update.
