<!--
{
  "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/fitted(toWindows:eventHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Create ML Components"
    ],
    "preciseIdentifier" : "s:18CreateMLComponents26LinearTimeSeriesForecasterV6fitted9toWindows12eventHandlerAC5ModelVyx_Gqd___yAA5EventVYbcSgtYaKSTRd__AA16AnnotatedFeatureVy6CoreML13MLShapedArrayVyxGARG7ElementRtd__lF"
  },
  "title" : "fitted(toWindows:eventHandler:)"
}
-->

# fitted(toWindows:eventHandler:)

Fits a model to a sequence of windows.

```
func fitted(toWindows input: some Sequence<AnnotatedFeature<MLShapedArray<Scalar>, MLShapedArray<Scalar>>>, eventHandler: EventHandler? = nil) async throws -> LinearTimeSeriesForecaster<Scalar>.Model
```

## Parameters

`input`

A sequence of annotated windows. Each window’s shape should be `[inputWindowSize, featureSize]`
and each annotation’s shape should be `[forecastWindowSize, annotationSize]`.

`eventHandler`

An event handler.

## Return Value

The fitted model.

---

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)