---
title: "fitted(to:eventHandler:)"
framework: createmlcomponents
role: symbol
role_heading: Instance Method
path: "createmlcomponents/preprocessingestimator/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 -> PreprocessingEstimator<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/preprocessingestimator/preprocessed(from:eventhandler:).md)
- [fitted(toPreprocessed:eventHandler:)](createmlcomponents/preprocessingestimator/fitted(topreprocessed:eventhandler:).md)
- [PreprocessingEstimator.Input](createmlcomponents/preprocessingestimator/input.md)
- [PreprocessingEstimator.Intermediate](createmlcomponents/preprocessingestimator/intermediate.md)
- [PreprocessingEstimator.Output](createmlcomponents/preprocessingestimator/output.md)
- [Transformer](createmlcomponents/transformer.md)
