'Opposite of the value of X on the K-means objective.
Parameters
X : {array-like, sparse matrix}, shape = [n_samples, n_features]
New data.
Returns
score : float
Opposite of the value of X on the K-means objective.'

def score(self, X, y=None):

    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_)[1])
