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

# fitted(to:validateOn:eventHandler:)

Fits a logistic regression classifier model to a sequence of examples.

## Declaration

```swift
func fitted<Input, Validation>(to input: Input, validateOn validation: Validation, eventHandler: EventHandler? = nil) async throws -> LogisticRegressionClassifierModel<Scalar, Label> where Input : Sequence, Validation : Sequence, Input.Element == AnnotatedFeature<MLShapedArray<Scalar>, Label>, Validation.Element == AnnotatedFeature<MLShapedArray<Scalar>, Label>
```

## Parameters

- `input`: A sequence of examples used for fitting the classifier.
- `validation`: A sequence of examples used for validating the fitted classifier.
- `eventHandler`: An event handler. This method reports accuracy metrics.

## Return Value

Return Value The fitted logistic regression classifier model.

## See Also

### Fitting

- [fitted(to:eventHandler:)](createmlcomponents/logisticregressionclassifier/fitted(to:eventhandler:).md)
- [LogisticRegressionClassifier.Annotation](createmlcomponents/logisticregressionclassifier/annotation.md)
- [LogisticRegressionClassifier.Transformer](createmlcomponents/logisticregressionclassifier/transformer.md)
