[…] Choice of distance: By default, the DISTANCE function computes the Euclidean distance. You can use the L1 or "Manhattan" distance instead by adding "L1" as a second argument. In theory, you can use any metric function such as the cosine similarity or Mahalanobis distance. …