TD_VectorDistance computes similarity or dissimilarity between two vectors in multi-dimensional space. The distance between vectors is usually calculated using a distance metric, such as Euclidean, Manhattan, or Cosine. It takes a table of target vectors, and a table of reference vectors and returns a table that contains the distance between target-reference pairs. The function computes the distance between the target pair and the reference pair from the same table if you provide only one table as the input.
Euclidean distance is the common distance metric used in machine learning algorithms, and it measures the straight-line distance between two points in a multidimensional space.
It is calculated by taking the square root of the sum of the squared differences between each corresponding dimension of the two vectors.
Manhattan distance measures the distance between two points by summing the absolute differences between their corresponding dimensions. It is useful when the dimensions have different scales or units.
Cosine similarity measures the angle between two vectors and is commonly used in natural language processing and information retrieval. It measures the cosine of the angle between two vectors, and its value ranges from -1 to 1, with 1 indicating that the vectors are identical and -1 indicating that they are completely dissimilar.