bundles / scipy latest / scipy / spatial / distance
module
scipy.spatial.distance
source: /scipy/spatial/distance.py :0
Members
-
_cdist_callable -
_convert_to_type -
_copy_array_if_base_present -
_correlation_cdist_wrap -
_correlation_pdist_wrap -
_nbool_correspond_all -
_nbool_correspond_ft_tf -
_np_pdist -
_pdist_callable -
_prepare_out_argument -
_validate_cdist_input -
_validate_hamming_kwargs -
_validate_mahalanobis_kwargs -
_validate_minkowski_kwargs -
_validate_pdist_input -
_validate_seuclidean_kwargs -
_validate_vector -
_validate_weight_with_size -
_validate_weights -
braycurtis -
canberra -
cdist -
CDistMetricWrapper -
chebyshev -
cityblock -
correlation -
cosine -
dice -
directed_hausdorff -
euclidean -
hamming -
is_valid_dm -
is_valid_y -
jaccard -
jensenshannon -
mahalanobis -
MetricInfo -
minkowski -
num_obs_dm -
num_obs_y -
pdist -
PDistMetricWrapper -
rogerstanimoto -
russellrao -
seuclidean -
sokalsneath -
sqeuclidean -
squareform -
yule
Summary
No Docstrings
Additional content
Distance computations (scipy.spatial.distance)
Function reference
Distance matrix computation from a collection of raw observation vectors stored in a rectangular array.
.. autosummary:: :toctree:generated/ pdist -- pairwise distances between observation vectors. cdist -- distances between two collections of observation vectors squareform -- convert distance matrix to a condensed one and vice versa directed_hausdorff -- directed Hausdorff distance between arrays
Predicates for checking the validity of distance matrices, both condensed and redundant. Also contained in this module are functions for computing the number of observations in a distance matrix.
.. autosummary:: :toctree:generated/ is_valid_dm -- checks for a valid distance matrix is_valid_y -- checks for a valid condensed distance matrix num_obs_dm -- # of observations in a distance matrix num_obs_y -- # of observations in a condensed distance matrix
Distance functions between two numeric vectors u and v. Computing distances over a large collection of vectors is inefficient for these functions. Use pdist for this purpose.
.. autosummary:: :toctree:generated/ braycurtis -- the Bray-Curtis distance. canberra -- the Canberra distance. chebyshev -- the Chebyshev distance. cityblock -- the Manhattan distance. correlation -- the Correlation distance. cosine -- the Cosine distance. euclidean -- the Euclidean distance. jensenshannon -- the Jensen-Shannon distance. mahalanobis -- the Mahalanobis distance. minkowski -- the Minkowski distance. seuclidean -- the normalized Euclidean distance. sqeuclidean -- the squared Euclidean distance.
Distance functions between two boolean vectors (representing sets) u and v. As in the case of numerical vectors, pdist is more efficient for computing the distances between all pairs.
.. autosummary:: :toctree:generated/ dice -- the Dice dissimilarity. hamming -- the Hamming distance. jaccard -- the Jaccard distance. rogerstanimoto -- the Rogers-Tanimoto dissimilarity. russellrao -- the Russell-Rao dissimilarity. sokalsneath -- the Sokal-Sneath dissimilarity. yule -- the Yule dissimilarity.
hamming also operates over discrete numerical vectors.
Aliases
-
scipy.spatial.distance