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

# fitted(to:validateOn:eventHandler:)

Fits a transformer to a sequence of examples while validating with a validation sequence.

## Declaration

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

## Mentioned in

Creating a multi-label image classifier

## Return Value

Return Value The fitted transformer.

## See Also

### Adapting and fitting

- [adaptedAsTemporal()](createmlcomponents/supervisedestimator/adaptedastemporal().md)
- [fitted(to:eventHandler:)](createmlcomponents/supervisedestimator/fitted(to:eventhandler:).md)
- [fitted(to:)](createmlcomponents/supervisedestimator/fitted(to:).md)
- [fitted(to:validateOn:)](createmlcomponents/supervisedestimator/fitted(to:validateon:).md)
