<!--
{
  "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/TimeSeriesForecasterAnnotatedWindows/init(features:annotations:inputWindowSize:forecastWindowSize:stride:shufflesElements:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Create ML Components"
    ],
    "preciseIdentifier" : "s:18CreateMLComponents36TimeSeriesForecasterAnnotatedWindowsV8features11annotations15inputWindowSize08forecastkL06stride16shufflesElementsACyxG6CoreML13MLShapedArrayVyxG_ANS3iSbtKcfc"
  },
  "title" : "init(features:annotations:inputWindowSize:forecastWindowSize:stride:shufflesElements:)"
}
-->

# init(features:annotations:inputWindowSize:forecastWindowSize:stride:shufflesElements:)

Creates a batch sequence.

```
init(features: MLShapedArray<Scalar>, annotations: MLShapedArray<Scalar>, inputWindowSize: Int, forecastWindowSize: Int, stride: Int = 1, shufflesElements: Bool = true) throws
```

## Parameters

`features`

A shaped array of features, it must have two dimensions.

`annotations`

A shaped array of annotations, it must have two dimensions.

`inputWindowSize`

The number of input samples. Must be positive.

`forecastWindowSize`

The number of prediction samples. Must be positive.

`stride`

The number of samples between windows.  Must be positive. Defaults to 1.

`shufflesElements`

A Boolean value indicating whether to shuffle the elements. Defaults to true.

---

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)