---
title: "getSimilarItems(fromItems:maxCount:)"
framework: createml
role: symbol
role_heading: Instance Method
path: "createml/mlrecommender/getsimilaritems(fromitems:maxcount:)"
---

# getSimilarItems(fromItems:maxCount:)

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

## Declaration

```swift
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.

## See Also

### Testing a recommender

- [recommendations(fromUsers:maxCount:restrictingToItems:excluding:excludingObserved:)](createml/mlrecommender/recommendations(fromusers:maxcount:restrictingtoitems:excluding:excludingobserved:).md)
- [MLIdentifier](createml/mlidentifier.md)
