Enumeration

NLDistanceType

The means of calculating a distance between two locations in a text embedding.

Declaration

enum NLDistanceType : Int

Overview

The meaning of an NLDistance is directly related to the NLDistanceType you use when you call a method that uses it. For example, if you use the neighbors(for:maximumCount:distanceType:) method and use NLDistanceType.cosine for the distanceType parameter, the method calculates the cosine distance and returns it as an NLDistance.

Topics

Distance Types

case cosine

A method of calculating distance by using cosine similarity.