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

# init(features:annotations:batchSize:inputWindowSize:forecastWindowSize:shufflesBatches:)

Creates a batch sequence.

```
init(features: MLShapedArray<Scalar>, annotations: MLShapedArray<Scalar>, batchSize: Int, inputWindowSize: Int, forecastWindowSize: Int, shufflesBatches: 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.

`batchSize`

The batch size. Must be positive.

`inputWindowSize`

The number of input samples. Must be positive.

`forecastWindowSize`

The number of prediction samples. Must be positive.

`shufflesBatches`

A Boolean value indicating whether to shuffle the batches.

---

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)