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

# fitted(to:validateOn:eventHandler:)

Fits a fully-connected network multi-label classifier model to a sequence of examples.

## Declaration

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

## Parameters

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

## Return Value

Return Value The fitted fully-connected network multi-label classifier model.

## Discussion

Discussion The training process partitions the input into random batches according to the batch size configuration parameter. Training stops when the validation loss stops improving or when the maximum number of iterations is reached.

## See Also

### Fitting a classifier

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