---
title: numberOfNeighbors
framework: coreml
role: symbol
role_heading: Type Property
path: coreml/mlparameterkey/numberofneighbors
---

# numberOfNeighbors

The key you use to access the number of neighbors that adjusts the affinity of a k-nearest-neighbor model.

## Declaration

```swift
class var numberOfNeighbors: MLParameterKey { get }
```

## Discussion

Discussion The value type for the numberOfNeighbors key is an Int64.

## See Also

### Accessing model parameters

- [linkedModelFileName](coreml/mlparameterkey/linkedmodelfilename.md)
- [linkedModelSearchPath](coreml/mlparameterkey/linkedmodelsearchpath.md)
