title: Input format for AffinityPropagation clustering
body: <p>I was using <code>scipy.cluster.hierarchy.linkage</code> method using a precomputed affinity matrix:</p>
  
  <p>Here is the code generating that upper triangular matrix:</p>
  
  <pre><code>distances = np.zeros((len(reprs), len(reprs))) * -1
  for i, j in it.combinations(range(len(reprs)), 2):
      distances[i][j] = (reprs[i] - reprs[j])**2
  </code></pre>
  
  <p>I can also represent it compactly:</p>
  
  <pre><code>distances = distances[np.triu_indices(len(reprs), 1)]
  </code></pre>
  
  <p>Now I wanted to try <code>sklearn.cluster.AffinityPropagation</code> instead, but I can't figure out how to send affinity matrix:</p>
  
  <pre><code>def affinity_cluster(distances):
      ap = sklearn.cluster.AffinityPropagation(preference="precomputed")
      d = ap.fit_predict(???)
  </code></pre>
  
  <p>From it's <a href="http://scikit-learn.org/stable/modules/generated/sklearn.cluster.AffinityPropagation.html#sklearn.cluster.AffinityPropagation.fit" rel="nofollow">documentation</a>:</p>
  
  <blockquote>
    <p>fit(X)
        Create affinity matrix from negative euclidean distances, then apply affinity propagation clustering.
        Parameters :  </p>
  
  <pre><code>X: array [n_samples, n_features] or [n_samples, n_samples] :
      Data matrix or, if affinity is precomputed, matrix of similarities / affinities.
  </code></pre>
    
    <p>fit_predict(X, y=None)
        Performs clustering on X and returns cluster labels.
        Parameters :  </p>
  
  <pre><code>X : ndarray, shape (n_samples, n_features)
      Input data.
  
  Returns : 
  
  y : ndarray, shape (n_samples,)
      cluster labels
  </code></pre>
  </blockquote>
  
  <p>So, they are expecting a tuple of two elements, but I have an M*N matrice or a vector of M*N/2 elements.</p>
  
  <p>So, how can I use <code>sklearn.cluster.AffinityPropogation</code> with an affinity matrix?</p>