<!--
{
  "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/LinearTimeSeriesForecaster/update(_:with:eventHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Create ML Components",
      "CreateMLComponents"
    ],
    "preciseIdentifier" : "s:18CreateMLComponents26LinearTimeSeriesForecasterV6update_4with12eventHandleryAC5ModelVyx_Gz_qd__yAA5EventVYbcSgtYaKSTRd__AA16AnnotatedFeatureVy6CoreML13MLShapedArrayVyxGARG7ElementRtd__lF"
  },
  "title" : "update(_:with:eventHandler:)"
}
-->

# update(_:with:eventHandler:)

Updates a model with a sequence of features.

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

## Parameters

`model`

The model to update.

`input`

A sequence of annotated features. The feature shape must be `[featureSize]` and the annotation shape
must be `[annotationSize]`.

`eventHandler`

An event handler.

## Discussion

This method uses a sliding window to chunk the input features into features of [`inputWindowSize`](/documentation/CreateMLComponents/LinearTimeSeriesForecaster/inputWindowSize) elements
and annotations of [`forecastWindowSize`](/documentation/CreateMLComponents/LinearTimeSeriesForecaster/forecastWindowSize) elements. If you want to use a different windowing strategy, use
[`update(_:withWindows:eventHandler:)`](/documentation/CreateMLComponents/LinearTimeSeriesForecaster/update(_:withWindows:eventHandler:)).

---

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)