Skip to content

Commit

Permalink
Merge pull request #116 from alexv71/master
Browse files Browse the repository at this point in the history
Added random_state argument to the cluster() method
  • Loading branch information
sevamoo authored Sep 29, 2020
2 parents d712db9 + ef3c215 commit 659a5a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
4 changes: 2 additions & 2 deletions sompy/sompy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 659a5a0

Please sign in to comment.