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

# init(features:annotations:)

Creates an annotated batch.

```
init(features: MLShapedArray<Scalar>, annotations: MLShapedArray<Scalar>)
```

## Parameters

`features`

A shaped array of features.

`annotations`

A shaped array of annotations.

## Discussion

The features and annotations must have the same rank, and the first dimensions must be equal.

---

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)