osier.utils.distance_matrix#
- osier.utils.distance_matrix(X, metric='euclidean')[source]#
This function calculates the distance matrix for an MxN matrix and returns the symmetrical square form of the matrix.
- Parameters:
X (
numpy.ndarray) – An MxN matrix.metric (str) –
The string describing how the metric should be calculated.
See the documentation for [scipy.spatial.distance.pdist](https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.distance.pdist.html) for a complete list of values. Default is ‘euclidean.’
- Returns:
D – An MxM matrix of distance values and zeros along the diagonal.
- Return type: