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

# fitted(to:eventHandler:)

Fits a fully connected network regressor model to a sequence of examples.

## Declaration

```swift
func fitted<Input>(to input: Input, eventHandler: EventHandler? = nil) async throws -> FullyConnectedNetworkRegressor<Scalar>.Transformer where Input : Sequence, Input.Element == AnnotatedFeature<MLShapedArray<Scalar>, Float>
```

## Parameters

- `input`: A sequence of examples used for fitting the transformer.
- `eventHandler`: An event handler.

## Return Value

Return Value The fitted transformer.

## Discussion

Discussion The training process partitions the input into random batches according to the batch size configuration parameter. Training stops when the maximum number of iterations is reached. note: This method does not do early-stopping, using a high value for maximumIterations may lead to over-fitting. Consider providing a validation set.

## See Also

### Fitting a regressor

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