<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateMLComponents",
  "identifier" : "/documentation/CreateMLComponents/MultivariateLinearRegressor/update(_:with:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Create ML Components",
      "CreateMLComponents"
    ],
    "preciseIdentifier" : "s:18CreateMLComponents27MultivariateLinearRegressorV6update_4withxAC5ModelVyx_Gz_AA14AnnotatedBatchVyxGtYaKF"
  },
  "title" : "update(_:with:)"
}
-->

# update(_:with:)

Updates a model with a new shaped array of examples.

```
func update(_ model: inout MultivariateLinearRegressor<Scalar>.Model, with input: AnnotatedBatch<Scalar>) async throws -> Scalar
```

## Parameters

`model`

A model to update.

`input`

An annotated batch containing the features and annotations. The last dimension of the features is
the model’s input size and the last dimension of the annotations is the model’s output size. All the
leading dimensions of the features must match all leading dimensions of the annotations. For example, the
feature shape can be `[N, X]` and the annotation shape can be `[N, Y]` for `N` examples where `X` is the
input size and `Y` is the output size.

## Return Value

The mean squared error for the batch, also known as the batch loss.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)