title: How to specify a distance function for clustering?
body: <p>I'd like to cluster points given to a custom distance and strangely, it seems that neither scipy nor sklearn clustering methods allow the specification of a distance function.</p>
  
  <p>For instance, in <code>sklearn.cluster.AgglomerativeClustering</code>, the only thing I may do is enter an affinity matrix (which will be very memory-heavy). In order to build this very matrix, it is recommended to use <code>sklearn.neighbors.kneighbors_graph</code>, but I don't understand how I can specify a distance function either between two points. Could someone enlighten me?</p>