docstr: Transforms X to cluster-distance space.
  
  Parameters
  ----------
  X : {array-like, sparse matrix}, shape (n_query, n_features),                 or (n_query, n_indexed) if metric == 'precomputed'
      Data to transform.
  
  Returns
  -------
  X_new : {array-like, sparse matrix}, shape=(n_query, n_clusters)
      X transformed in the new space of distances to cluster centers.
docstr_tok: ["Transforms","X","to","cluster-distance","space",".","Parameters","--","--","--","--","--","X",":","{","array-like",",","sparse","matrix","}",",","shape","(","n_query",",","n_features",")",",","or","(","n_query",",","n_indexed",")","if","metric","==","'precomputed'","Data","to","transform",".","Returns","--","--","--","-","X_new",":","{","array-like",",","sparse","matrix","}",",","shape=","(","n_query",",","n_clusters",")","X","transformed","in","the","new","space","of","distances","to","cluster","centers","."]
code: def transform(self, X):
      """Transforms X to cluster-distance space.
  
          Parameters
          ----------
          X : {array-like, sparse matrix}, shape (n_query, n_features), \
                  or (n_query, n_indexed) if metric == 'precomputed'
              Data to transform.
  
          Returns
          -------
          X_new : {array-like, sparse matrix}, shape=(n_query, n_clusters)
              X transformed in the new space of distances to cluster centers.
          """
      X = check_array(X, accept_sparse=["csr", "csc"])
      check_is_fitted(self, "cluster_centers_")
  
      Y = self.cluster_centers_
      return pairwise_distances(X, Y=Y, metric=self.metric)
  
imports: import warnings
  import numpy
  from sklearn.base import BaseEstimator, ClusterMixin
  from sklearn.exceptions import ConvergenceWarning
  from sklearn.metrics.pairwise import pairwise_distances, pairwise_distances_argmin
  from sklearn.utils import check_array
  from sklearn.utils.validation import check_is_fitted
label_desc: Use image node_id 9 for calling the KMedoids obj's underlying member method code with example usage: obj.transform(X) and returns: pairwise_distances