muspan.helpers.

object_to_object_distance_matrix#

object_to_object_distance_matrix(domain, population_A, population_B, overwrite_cache=False, bypass_checks=False, distance_metric='euclidean')#

Return a distance matrix for the minimum distance from each object in population_A to each object in population_B.

Parameters:
domainmuspan domain

The domain containing the objects.

population_Aquery-like

A query-like object or a list that can be interpreted into a list of object IDs of length n_A.

population_Bquery-like

A query-like object or a list that can be interpreted into a list of object IDs of length n_B.

overwrite_cachebool

If True, rewrite previously cached distances. If False, existing distances will be retrieved from the ‘object_boundary_distance_cache’. Defaults to False.

bypass_checksbool, optional

If True, standard checks on whether this query can be interpreted are bypassed. May generate unexpected crashes if objects that can’t be interpreted as a query are passed in, but generates a substantial speed increase for large datasets when we’re confident the query is formatted correctly. Defaults to False.

distance_metricstr, optional

The metric used to compute distances between objects. Default is ‘euclidean’.

Returns:
distance_matrixndarray

An n_A x n_B matrix containing minimum distances between objects A and B.