'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_indices_')
    if (not hasattr(self, 'cluster_centers_')):
        raise ValueError("Predict    method    is    not    supported    when    affinity='precomputed'.")
    return pairwise_distances_argmin(X, self.cluster_centers_)
