skbio.stats.distance.
DistanceMatrix
(data, ids=None)[source]¶Store distances between objects.
A DistanceMatrix is a DissimilarityMatrix with the additional requirement that the matrix data is symmetric. There are additional methods made available that take advantage of this symmetry.
See also
Notes
The distances are stored in redundant (square-form) format 1. To facilitate use with other scientific Python routines (e.g., scipy), the distances can be retrieved in condensed (vector-form) format using condensed_form.
DistanceMatrix only requires that the distances it stores are symmetric. Checks are not performed to ensure the other three metric properties hold (non-negativity, identity of indiscernibles, and triangle inequality) 2. Thus, a DistanceMatrix instance can store distances that are not metric.
References
Attributes
|
Transpose of the dissimilarity matrix. |
|
Array of dissimilarities. |
|
|
|
Data type of the dissimilarities. |
|
Tuple of object IDs. |
|
Display heatmap in IPython Notebook as PNG. |
|
Two-element tuple containing the dissimilarity matrix dimensions. |
|
Total number of elements in the dissimilarity matrix. |
|
Display heatmap in IPython Notebook as SVG. |
Built-ins
Check if the specified ID is in the dissimilarity matrix. |
|
Compare this dissimilarity matrix to another for equality. |
|
Slice into dissimilarity data by object ID or numpy indexing. |
|
Determine whether two dissimilarity matrices are not equal. |
|
Return a string representation of the dissimilarity matrix. |
Methods
|
Obtain the distances between the two groups of IDs |
Return an array of distances in condensed format. |
|
|
Return a deep copy of the dissimilarity matrix. |
|
Filter the dissimilarity matrix by IDs. |
|
Create DistanceMatrix from all pairs in an iterable given a metric. |
|
Return the index of the specified ID. |
|
Randomly permute both rows and columns in the matrix. |
|
Creates a heatmap of the dissimilarity matrix |
|
Create a new |
Return an array of dissimilarities in redundant format. |
|
Create a |
|
Create a |
|
Return the transpose of the dissimilarity matrix. |
|
|
Obtain all the distances among the set of IDs |
|
Write an instance of |