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

# fitted(to:validateOn:eventHandler:)

Fits a transformer to a data frame

## Declaration

```swift
func fitted(to input: DataFrame, validateOn validation: DataFrame?, eventHandler: EventHandler? = nil) async throws -> PreprocessingSupervisedTabularEstimator<Preprocessor, Estimator>.Transformer
```

## Parameters

- `input`: A data frame containing examples used for fitting the transformer.
- `validation`: A data frame containing examples used for validating the fitted transformer.
- `eventHandler`: An event handler.

## Return Value

Return Value The fitted transformer.

## See Also

### Preprocesing and fitting

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