---
title: "update(_:with:eventHandler:)"
framework: createmlcomponents
role: symbol
role_heading: Instance Method
path: "createmlcomponents/multivariatelinearregressor/update(_:with:eventhandler:)"
---

# update(_:with:eventHandler:)

Updates a model with a new sequence of examples.

## Declaration

```swift
func update(_ model: inout MultivariateLinearRegressor<Scalar>.Model, with input: some Sequence<AnnotatedFeature<MLShapedArray<Scalar>, MLShapedArray<Scalar>>>, eventHandler: EventHandler? = nil) async throws
```

## Parameters

- `model`: A model to update.
- `input`: A sequence of examples. For faster updates, consider passing a single doc://com.apple.createmlcomponents/documentation/CreateMLComponents/AnnotatedBatch with shaped arrays that contain multiple training examples. For example instead of passing a sequence of N shaped arrays with shape [M], pass a single shaped array with shape [N, M]. See also doc://com.apple.createmlcomponents/documentation/CreateMLComponents/MultivariateLinearRegressor/update(_:with:).
- `eventHandler`: An event handler. This method reports the mean squared error.

## See Also

### Fitting Progressively

- [makeTransformer()](createmlcomponents/multivariatelinearregressor/maketransformer().md)
- [update(_:with:)](createmlcomponents/multivariatelinearregressor/update(_:with:).md)
