<!--
{
  "availability" : [
    "macOS: 10.15.0 - 14.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "CreateML",
  "identifier" : "/documentation/CreateML/MLIdentifier",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Create ML"
    ],
    "preciseIdentifier" : "s:8CreateML12MLIdentifierP"
  },
  "title" : "MLIdentifier"
}
-->

# MLIdentifier

A type the Create ML framework can use as a machine learning identifier.

```
protocol MLIdentifier
```

## Overview

You can use any type that conforms to the [`MLIdentifier`](/documentation/CreateML/MLIdentifier) protocol,
typically <doc://com.apple.documentation/documentation/Swift/Int> or
<doc://com.apple.documentation/documentation/Swift/String>, to uniquely
identify users and items in these [`MLRecommender`](/documentation/CreateML/MLRecommender) methods:

- 

[`recommendations(fromUsers:maxCount:restrictingToItems:excluding:excludingObserved:)`](/documentation/CreateML/MLRecommender/recommendations(fromUsers:maxCount:restrictingToItems:excluding:excludingObserved:)-7an46)

- [`getSimilarItems(fromItems:maxCount:)`](/documentation/CreateML/MLRecommender/getSimilarItems(fromItems:maxCount:)-kq37)

## Topics

### Getting an identifier

[`var identifierValue: MLDataValue`](/documentation/CreateML/MLIdentifier/identifierValue)

The value of the unique identifier wrapped in a data value.



---

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)