Contents

init(capacity:dimensionCount:neighborCount:dataType:)

Returns a new k-nearest neighbors object.

Declaration

init(capacity: Int, dimensionCount: Int, neighborCount: Int, dataType: BNNSDataType)

Parameters

  • capacity:

    The maximum number of data points.

  • dimensionCount:

    The number of features or dimensions of each data point.

  • neighborCount:

    The number of nearest neighbors that a subsequent call to Apply(index:outputindices:outputdistances:) calculates.

  • dataType:

    The data type of the data points. This must be either BNNSDataTypeFloat32 or BNNSDataTypeFloat16.