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

# fitted(to:validateOn:eventHandler:)

Fits a transformer to a sequence of examples.

## Declaration

```swift
func fitted<Input, Validation>(to input: Input, validateOn validation: Validation, eventHandler: EventHandler? = nil) async throws -> EstimatorToSupervisedAdaptor<Estimator, Annotation>.Transformer where Input : Sequence, Validation : Sequence, Input.Element == AnnotatedFeature<Estimator.Transformer.Input, Annotation>, Validation.Element == AnnotatedFeature<Estimator.Transformer.Input, 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

### Fitting a transformer

- [fitted(to:eventHandler:)](createmlcomponents/estimatortosupervisedadaptor/fitted(to:eventhandler:).md)
- [Transformer](createmlcomponents/transformer.md)
