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

# fitted(to:eventHandler:)

Fits a composed transformer to a sequence of examples.

## Declaration

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

## Parameters

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

## Return Value

Return Value The fitted transformer.

## See Also

### Preprocesing and fitting

- [preprocessed(from:eventHandler:)](createmlcomponents/preprocessingupdatableestimator/preprocessed(from:eventhandler:).md)
- [fitted(toPreprocessed:eventHandler:)](createmlcomponents/preprocessingupdatableestimator/fitted(topreprocessed:eventhandler:).md)
- [makeTransformer()](createmlcomponents/preprocessingupdatableestimator/maketransformer().md)
- [update(_:with:eventHandler:)](createmlcomponents/preprocessingupdatableestimator/update(_:with:eventhandler:).md)
- [update(_:withPreprocessed:eventHandler:)](createmlcomponents/preprocessingupdatableestimator/update(_:withpreprocessed:eventhandler:).md)
- [PreprocessingUpdatableEstimator.Input](createmlcomponents/preprocessingupdatableestimator/input.md)
- [PreprocessingUpdatableEstimator.Intermediate](createmlcomponents/preprocessingupdatableestimator/intermediate.md)
- [PreprocessingUpdatableEstimator.Output](createmlcomponents/preprocessingupdatableestimator/output.md)
- [Transformer](createmlcomponents/transformer.md)
