title: Python Clustering Algorithms
body: <p>I've been looking around scipy and sklearn for clustering algorithms for a particular problem I have. I need some way of characterizing a population of N particles into k groups, where k is not necessarily know, and in addition to this, no a priori linking lengths are known (similar to this <a href="https://stackoverflow.com/questions/3891645/clustering-problem">question</a>). </p>
  
  <p>I've tried kmeans, which works well if you <strong><em>know</em></strong> how many clusters you want. I've tried dbscan, which does poorly unless you <strong><em>tell</em></strong> it a characteristic length scale on which to stop looking (or start looking) for clusters. The problem is, I have potentially thousands of these clusters of particles, and I cannot spend the time to tell kmeans/dbscan algorithms what they should go off of. </p>
  
  <p>Here is an example of what dbscan find:
  <img src="https://i.stack.imgur.com/Nss97.png" alt="dbscanfail"></p>
  
  <p>You can see that there really are two separate populations here, though adjusting the epsilon factor (the max. distance between neighboring clusters parameter), I simply cannot get it to see those two populations of particles. </p>
  
  <p>Is there any other algorithms which would work here? I'm looking for minimal information upfront - in other words, I'd like the algorithm to be able to make "smart" decisions about what could constitute a separate cluster.</p>