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

# fitted(to:eventHandler:)

Fits a transformer to a sequence of examples.

## Declaration

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

## Parameters

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

## Return Value

Return Value The fitted transformer.

## See Also

### Fitting and adapting

- [adaptedAsSupervised(annotationType:)](createmlcomponents/estimator/adaptedassupervised(annotationtype:).md)
- [adaptedAsTemporal()](createmlcomponents/estimator/adaptedastemporal().md)
- [fitted(to:)](createmlcomponents/estimator/fitted(to:).md)
