<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateMLComponents",
  "identifier" : "/documentation/CreateMLComponents/MLModelClassifierAdaptor",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Create ML Components"
    ],
    "preciseIdentifier" : "s:18CreateMLComponents24MLModelClassifierAdaptorV"
  },
  "title" : "MLModelClassifierAdaptor"
}
-->

# MLModelClassifierAdaptor

A transformer that uses a Core ML model as a classifier.

```
struct MLModelClassifierAdaptor<Scalar> where Scalar : MLShapedArrayScalar, Scalar : BinaryFloatingPoint
```

## Topics

### Creating a transformer

[`init(model: MLModel) throws`](/documentation/CreateMLComponents/MLModelClassifierAdaptor/init(model:))

Creates a MLModel classifier adaptor from a model.

[`init(contentsOf: URL, configuration: MLModelConfiguration) throws`](/documentation/CreateMLComponents/MLModelClassifierAdaptor/init(contentsOf:configuration:))

Creates a model adaptor from a CoreML model URL.

### Getting the model

[`let model: MLModel`](/documentation/CreateMLComponents/MLModelClassifierAdaptor/model)

The CoreML model.

### Performing the transformation

[`func applied(to: MLShapedArray<Scalar>, eventHandler: EventHandler?) async throws -> ClassificationDistribution<MLModelClassifierAdaptor<Scalar>.Label>`](/documentation/CreateMLComponents/MLModelClassifierAdaptor/applied(to:eventHandler:))

Performs a prediction from a single input.

[`enum Label`](/documentation/CreateMLComponents/MLModelClassifierAdaptor/Label)

The classifier label type.

## Relationships

### Conforms To

[`Transformer`](/documentation/CreateMLComponents/Transformer)

[`Classifier`](/documentation/CreateMLComponents/Classifier)

---

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)