<!--
{
  "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",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Create ML Components"
    ],
    "preciseIdentifier" : "s:18CreateMLComponents14AnnotatedBatchV"
  },
  "title" : "AnnotatedBatch"
}
-->

# AnnotatedBatch

A batch of annotated examples for fitting a supervised estimator.

```
struct AnnotatedBatch<Scalar> where Scalar : MLShapedArrayScalar
```

## Topics

### Creating an annotated batch

[`init(features: MLShapedArray<Scalar>, annotations: MLShapedArray<Scalar>)`](/documentation/CreateMLComponents/AnnotatedBatch/init(features:annotations:))

Creates an annotated batch.

### Inspecting an annotated batch

[`var annotations: MLShapedArray<Scalar>`](/documentation/CreateMLComponents/AnnotatedBatch/annotations)

The shaped array of annotations.

[`var count: Int`](/documentation/CreateMLComponents/AnnotatedBatch/count)

The number of examples in the batch.

[`var features: MLShapedArray<Scalar>`](/documentation/CreateMLComponents/AnnotatedBatch/features)

The shaped array of features.

## Relationships

### Conforms To

[`Decodable`](/documentation/Swift/Decodable)

[`Escapable`](/documentation/Swift/Escapable)

[`Equatable`](/documentation/Swift/Equatable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Copyable`](/documentation/Swift/Copyable)

[`Encodable`](/documentation/Swift/Encodable)

[`Sendable`](/documentation/Swift/Sendable)

---

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)