Skip to content

Commit

Permalink
Add size check before trying to split
Browse files Browse the repository at this point in the history
  • Loading branch information
pberba committed Oct 19, 2019
1 parent 049288e commit 9c8df21
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions autosklearn/metalearning/metalearning/clustering/gmeans.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ def fit(self, X):
indices = KMeans.labels_ == i
X_ = X[indices]

if np.sum(indices) < self.minimum_samples_per_cluster*2:
cluster_centers.append(cluster_center)
continue

for i in range(10):
KMeans_ = sklearn.cluster.KMeans(n_clusters=2,
n_init=self.n_init,
Expand Down

0 comments on commit 9c8df21

Please sign in to comment.