<!--
{
  "availability" : [
    "macOS: 10.15.0 - 14.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "CreateML",
  "identifier" : "/documentation/CreateML/MLRecommender/getSimilarItems(fromItems:maxCount:)-kq37",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Create ML",
      "CreateML"
    ],
    "preciseIdentifier" : "s:8CreateML13MLRecommenderV15getSimilarItems04fromF08maxCountAA11MLDataTableVSayAA12MLIdentifier_pG_SitKF"
  },
  "title" : "getSimilarItems(fromItems:maxCount:)"
}
-->

# getSimilarItems(fromItems:maxCount:)

Returns the top ranked similar items based on the model’s similarity
type.

```
func getSimilarItems(fromItems: [any MLIdentifier], maxCount: Int = 10) throws -> MLDataTable
```

## Parameters

`fromItems`

An array of item identifiers.

`maxCount`

The maximum number of similar items per item in the
`fromItems` column. The default is `10`.

---

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)