HierarchicalClustering`
HierarchicalClustering`
DistanceMatrix
As of Version 10.3, DistanceMatrix is built into the Wolfram System.
DistanceMatrix[list]
gives a matrix of distances or dissimilarities between the elements of list.
Details and Options
- To use DistanceMatrix, you first need to load the Hierarchical Clustering Package using Needs["HierarchicalClustering`"].
- The elements of list can be numeric lists, matrices, or tensors, lists of Boolean elements, or strings. All data elements must have the same dimensions.
- DistanceMatrix returns a symmetric matrix suitable for use by DirectAgglomerate.
- The method used to compute dissimilarities can be selected with the DistanceFunction option.
- With the default setting DistanceFunction->Automatic, DistanceMatrix uses the square of EuclideanDistance for numeric data, JaccardDissimilarity for Boolean data, and EditDistance for string data.
- The setting for DistanceFunction can be any distance or dissimilarity function or a pure function f defining a distance between two values.
Examples
open allclose allOptions (1)
DistanceFunction (1)
Distance matrix using ManhattanDistance:
Wolfram Research (2007), DistanceMatrix, Wolfram Language function, https://reference.wolfram.com/language/HierarchicalClustering/ref/DistanceMatrix.html.
Text
Wolfram Research (2007), DistanceMatrix, Wolfram Language function, https://reference.wolfram.com/language/HierarchicalClustering/ref/DistanceMatrix.html.
CMS
Wolfram Language. 2007. "DistanceMatrix." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/HierarchicalClustering/ref/DistanceMatrix.html.
APA
Wolfram Language. (2007). DistanceMatrix. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/HierarchicalClustering/ref/DistanceMatrix.html