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

# fitted(to:eventHandler:)

Fits a composed transformer to a sequence of examples.

## Declaration

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

## Parameters

- `input`: A sequence of examples used for fitting the transformer.
- `eventHandler`: An event handler.

## Return Value

Return Value The fitted transformer.

## See Also

### Preprocesing and fitting

- [preprocessed(from:eventHandler:)](createmlcomponents/preprocessingupdatablesupervisedestimator/preprocessed(from:eventhandler:).md)
- [fitted(toPreprocessed:eventHandler:)](createmlcomponents/preprocessingupdatablesupervisedestimator/fitted(topreprocessed:eventhandler:).md)
- [fitted(to:validateOn:eventHandler:)](createmlcomponents/preprocessingupdatablesupervisedestimator/fitted(to:validateon:eventhandler:).md)
- [fitted(toPreprocessed:validateOn:eventHandler:)](createmlcomponents/preprocessingupdatablesupervisedestimator/fitted(topreprocessed:validateon:eventhandler:).md)
- [makeTransformer()](createmlcomponents/preprocessingupdatablesupervisedestimator/maketransformer().md)
- [update(_:with:eventHandler:)](createmlcomponents/preprocessingupdatablesupervisedestimator/update(_:with:eventhandler:).md)
- [update(_:withPreprocessed:eventHandler:)](createmlcomponents/preprocessingupdatablesupervisedestimator/update(_:withpreprocessed:eventhandler:).md)
- [PreprocessingUpdatableSupervisedEstimator.Annotation](createmlcomponents/preprocessingupdatablesupervisedestimator/annotation.md)
- [PreprocessingUpdatableSupervisedEstimator.Input](createmlcomponents/preprocessingupdatablesupervisedestimator/input.md)
- [PreprocessingUpdatableSupervisedEstimator.Intermediate](createmlcomponents/preprocessingupdatablesupervisedestimator/intermediate.md)
- [PreprocessingUpdatableSupervisedEstimator.Output](createmlcomponents/preprocessingupdatablesupervisedestimator/output.md)
- [Transformer](createmlcomponents/transformer.md)
