user6408904
user6408904

Reputation: 51

Hierarchial Clustering in python using DTW distance

I am trying to use DTW(dynamic time warping) distance to create hierarchical clustering in python.I am able to compute distances using DTW package but not sure of supplying userdefined distance to hierarchial clustering in scipy.

Any thoughts on how to proceed would be a great help. thanks

Upvotes: 4

Views: 3052

Answers (1)

Has QUIT--Anony-Mousse
Has QUIT--Anony-Mousse

Reputation: 77464

Please study the scikit learn documentation.

affinity : string or callable, default: “euclidean”

Metric used to compute the linkage. Can be “euclidean”, “l1”, “l2”, “manhattan”, “cosine”, or ‘precomputed’.

Or if you are using scipy without scikit-learn, there also is documentation.

y : ndarray

A condensed or redundant distance matrix. A condensed distance matrix is a flat array containing the upper triangular of the distance matrix. This is the form that pdist returns. Alternatively, a collection of (m) observation vectors in n dimensions may be passed as an (m) by (n) array.

Upvotes: 1

Related Questions