'Predict the closest cluster each sample in X belongs to.
In the vector quantization literature, `cluster_centers_` is called
the code book and each value returned by `predict` is the index of
the closest code in the code book.
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_')
    X = self._check_test_data(X)
    x_squared_norms = row_norms(X, squared=True)
    return _labels_inertia(X, x_squared_norms, self.cluster_centers_)[0]
