'Predict the closest cluster each sample in X belongs to.
Parameters
X : {array-like, sparse matrix}, shape=[n_samples, n_features]
New data to predict.
Returns
labels : array, shape [n_samples,]
Index of the cluster each sample belongs to.'

def predict(self, X):

    check_is_fitted(self, 'cluster_centers_')
    return pairwise_distances_argmin(X, self.cluster_centers_)
