diff --git a/setup.py b/setup.py index 13acc75..512f36e 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name="SOMPY", - version="1.1", + version="1.1.1", description="Self Organizing Maps Package", author="Vahid Moosavi and Sebastian Packmann", packages=find_packages(), diff --git a/sompy/sompy.py b/sompy/sompy.py index 646f4dc..bc9d779 100644 --- a/sompy/sompy.py +++ b/sompy/sompy.py @@ -534,9 +534,9 @@ def bmu_ind_to_xy(self, bmu_ind): return out.astype(int) - def cluster(self, n_clusters=8): + def cluster(self, n_clusters=8, random_state=0): import sklearn.cluster as clust - cl_labels = clust.KMeans(n_clusters=n_clusters).fit_predict( + cl_labels = clust.KMeans(n_clusters=n_clusters, random_state=random_state).fit_predict( self._normalizer.denormalize_by(self.data_raw, self.codebook.matrix)) self.cluster_labels = cl_labels