title: Agglomerative clustering using DTW distance matrix
body: <p>I am trying to cluster a dataset of time series. For this I have computed pairwise DTW distance. These data is collected in a distance matrix which I would like to use as input for AgglomerativeClustering() sklearn method.</p>
  
  <p>It seems I need to use a condensed distance matrix for it. But if I do that, the clustering method interprets each distance as a new sample so I get too many labels. How should I properly do this?</p>
  
  <p>This is a sample code I have tried:</p>
  
  <pre><code>import numpy as np
  
  # Test symmetric matrix
  N = 4
  b = np.random.randint(0,5,size=(N,N))
  b_symm = (b + b.T)/2
  np.fill_diagonal(b_symm,np.zeros(N))
  
  # Condensed matrix
  condensed = squareform(b_symm)
  model = AgglomerativeClustering(n_clusters=2, linkage=linkage)
  y = model.fit_predict(condensed.reshape(-1,1))
  </code></pre>