Skip to main content
`Ctrl`+`K`

# skbio.embedding.embed_vec_to_distances

skbio.embedding.embed_vec_to_distances(vectors, metric='euclidean', validate=True)

  Convert EmbeddingVector objects to a DistanceMatrix object.

  Parameters:
    vectors iterable of EmbeddingVector objects

      An iterable of EmbeddingVector objects, or objects that subclass EmbeddingVector.

    metric str or callable, optional

      The distance metric to use. Must be a valid metric for `scipy.spatial.distance.pdist`.

    validate bool, optional

      If `True`, validate that all vectors have the same length and are valid types.

  Returns:
    DistanceMatrix

      A distance matrix representing pairwise distances among objects calculated by the given metric.

  See also

  `skbio.stats.distance.DistanceMatrix`