Fixes cluster count determination

Original determination of number of clusters had a guard that was wrong
(using JS-style checking for presence of a particular function rather
than hasattr()). As clustering-like algorithms in scikit learn differ,
an additional test has been included that works with (at least; possibly
only?) KMeans.