'Transform X to a cluster-distance space.
In the new space, each dimension is the distance to the cluster
centers.  Note that even if X is sparse, the array returned by
`transform` will typically be dense.
Parameters
X : {array-like, sparse matrix}, shape = [n_samples, n_features]
New data to transform.
Returns
X_new : array, shape [n_samples, k]
X transformed in the new space.'

def transform(self, X):

    check_is_fitted(self, 'cluster_centers_')
    X = self._check_test_data(X)
    return self._transform(X)
