---
title: "update(_:withWindows:eventHandler:)"
framework: createmlcomponents
role: symbol
role_heading: Instance Method
path: "createmlcomponents/lineartimeseriesforecaster/update(_:withwindows:eventhandler:)"
---

# update(_:withWindows:eventHandler:)

Updates a model with a sequence of windows.

## Declaration

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

## Parameters

- `model`: The model to update.
- `windows`: A sequence of annotated windows. The feature shape must be [inputWindowSize, featureSize] and the annotation shape must be [forecastWindowSize, annotationSize].
- `eventHandler`: An event handler.

## Discussion

Discussion For faster updates, consider passing a single AnnotatedBatch with shaped arrays that contain multiple training examples. See update(_:with:).

## See Also

### Updating and fitting

- [update(_:with:)](createmlcomponents/lineartimeseriesforecaster/update(_:with:).md)
- [fitted(to:eventHandler:)](createmlcomponents/lineartimeseriesforecaster/fitted(to:eventhandler:).md)
- [fitted(to:validateOn:eventHandler:)](createmlcomponents/lineartimeseriesforecaster/fitted(to:validateon:eventhandler:).md)
- [fitted(toWindows:eventHandler:)](createmlcomponents/lineartimeseriesforecaster/fitted(towindows:eventhandler:).md)
- [fitted(toWindows:validateOn:eventHandler:)](createmlcomponents/lineartimeseriesforecaster/fitted(towindows:validateon:eventhandler:).md)
