skbio.embedding.embed_vec_to_distances#

skbio.embedding.embed_vec_to_distances(vectors, metric='euclidean', validate=True)[source]#

Convert EmbeddingVector objects to a DistanceMatrix object.

Parameters:
vectorsiterable of EmbeddingVector objects

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

metricstr or callable, optional

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

validatebool, 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.