diff --git a/autosklearn/metalearning/metalearning/clustering/gmeans.py b/autosklearn/metalearning/metalearning/clustering/gmeans.py index a1e66ce976..573537e446 100644 --- a/autosklearn/metalearning/metalearning/clustering/gmeans.py +++ b/autosklearn/metalearning/metalearning/clustering/gmeans.py @@ -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,