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

# fitted(to:validateOn:eventHandler:)

Fits a composed transformer to a sequence of examples.

## Declaration

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

## Parameters

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

## Return Value

Return Value The fitted transformer.

## See Also

### Preprocessing and fitting

- [preprocessed(from:eventHandler:)](createmlcomponents/preprocessingsupervisedestimator/preprocessed(from:eventhandler:).md)
- [fitted(to:eventHandler:)](createmlcomponents/preprocessingsupervisedestimator/fitted(to:eventhandler:).md)
- [fitted(toPreprocessed:eventHandler:)](createmlcomponents/preprocessingsupervisedestimator/fitted(topreprocessed:eventhandler:).md)
- [fitted(toPreprocessed:validateOn:eventHandler:)](createmlcomponents/preprocessingsupervisedestimator/fitted(topreprocessed:validateon:eventhandler:).md)
- [PreprocessingSupervisedEstimator.Annotation](createmlcomponents/preprocessingsupervisedestimator/annotation.md)
- [PreprocessingSupervisedEstimator.Input](createmlcomponents/preprocessingsupervisedestimator/input.md)
- [PreprocessingSupervisedEstimator.Intermediate](createmlcomponents/preprocessingsupervisedestimator/intermediate.md)
- [PreprocessingSupervisedEstimator.Output](createmlcomponents/preprocessingsupervisedestimator/output.md)
- [Transformer](createmlcomponents/transformer.md)
