title: Finding possible thresholds for clustering
body: <p>I'm fiddling around with scipys <a href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.cluster.hierarchy.fcluster.html" rel="nofollow noreferrer">fcluster</a>.</p>
  <pre><code>linkage(p, 'single', 'euclidean')
  fcluster(Z, t, criterion='distance')
  </code></pre>
  <p>In particular, I am looking for the right value(s) for the threshold parameter <strong>t</strong>.
  I would like to iterate over all threshold values that generate different results.</p>
  <p>So far I am sampling the threshold which often leads to generating the same clustering multiple times and there is no guarantee that a clustering isn't missed.</p>
  <p>Is there a way to generate all threshold values at which the resulting clustering will change?</p>
  <p>I tried using the values from <a href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.distance.pdist.html#scipy.spatial.distance.pdist" rel="nofollow noreferrer">pdist</a> as potential candidates but noticed that there are still duplicates in the resulting clustering.</p>