DistanceMetric

public enum DistanceMetric : String

Supported distance metrics / similarity measures

  • The angular distance used is the Euclidean distance of normalized vectors, which is sqrt(2(1-cos(u,v)))

    Declaration

    Swift

    case angular
  • The dot product also called the inner product.

    Declaration

    Swift

    case dotProduct
  • The L2 or straight line distance as calculated using the Pythagorean formula

    Declaration

    Swift

    case euclidean
  • The L1 or city block distance

    Declaration

    Swift

    case manhattan