We're required to pass a distance matrix, so there should be no need to calculate any additional distances, right? What am I missing?
Documentation here: http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.cluster.hierarchy.linkage.html
The linkage
function does not need the metric
argument, unlees you pass in your original observations instead of a distance matrix.
From your posted link
y : ndarray
[...] Alternatively, a collection of m observation vectors in n dimensions may be passed as an m by n array.
The linkage
function checks, if you passed in a valid distance matrix - presumable using is_valid_y
/ is_valid_dm
- and if not it will first apply pdist
with the metric you have specified (and euclidean metric if nothing has been specified).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With