---
title: "fitted(to:eventHandler:)"
framework: createmlcomponents
role: symbol
role_heading: Instance Method
path: "createmlcomponents/ordinalencoder/fitted(to:eventhandler:)"
---

# fitted(to:eventHandler:)

Fits an ordinal encoder to a sequence of categories.

## Declaration

```swift
func fitted<S>(to input: S, eventHandler: EventHandler? = nil) throws -> OrdinalEncoder<Category>.Transformer where S : Sequence, S.Element == Category?
```

## Parameters

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

## Return Value

Return Value The fitted transformer.
