title: How to decide the numbers of clusters based on a distance threshold between clusters for agglomerative clustering with sklearn?
body: <p>With <code>sklearn.cluster.AgglomerativeClustering</code> from <code>sklearn</code> I need to specify the number of resulting clusters in advance. What I would like to do instead is to <strong>merge clusters until a certain maximum distance between clusters</strong> is reached and then stop the clustering process.</p>
  
  <p>Accordingly, the number of clusters might vary depending on the structure of the data. I also do not care about the number of resulting clusters nor the size of the clusters but only that the cluster centroids do not exceed a certain distance.</p>
  
  <p>How can I achieve this? </p>