Distance matrices are a really useful data structure that store pairwise information about how observations from a dataset relate to one another. In machine learning they are used for tasks like hierarchical clustering of phylogenic trees (looking at genetic ancestry) and in natural language processing (NLP) models for exploring the relationships between words (with word embeddings like Word2Vec, GloVe, fastText, etc.). Here, we will briefly go over how to implement a function in python that can be used to efficiently compute the pairwise distances for a set or sets of vectors.
Read more