class_docstr: A class for feature agglomeration via the transform interface.
docstr: Transform a new matrix using the built clustering.
  
  Parameters
  ----------
  X : array-like of shape (n_samples, n_features) or                 (n_samples, n_samples)
      A M by N array of M observations in N dimensions or a length
      M array of M one-dimensional observations.
  
  Returns
  -------
  Y : ndarray of shape (n_samples, n_clusters) or (n_clusters,)
      The pooled values for each feature cluster.
code: def transform(self, X):
      """
          Transform a new matrix using the built clustering.
  
          Parameters
          ----------
          X : array-like of shape (n_samples, n_features) or \
                  (n_samples, n_samples)
              A M by N array of M observations in N dimensions or a length
              M array of M one-dimensional observations.
  
          Returns
          -------
          Y : ndarray of shape (n_samples, n_clusters) or (n_clusters,)
              The pooled values for each feature cluster.
          """
      check_is_fitted(self)
  
      X = self._validate_data(X, reset=False)
      if self.pooling_func == np.mean and not issparse(X):
          size = np.bincount(self.labels_)
          n_samples = X.shape[0]
          # a fast way to compute the mean of grouped features
          nX = np.array(
              [
                  np.bincount(self.labels_, X[i, :]) / size
                  for i in range(n_samples)
              ]
          )
      else:
          nX = [
              self.pooling_func(X[:, self.labels_ == l], axis=1)
              for l in np.unique(self.labels_)
          ]
          nX = np.array(nX).T
      return nX
  
file_path: catboost/contrib/python/scikit-learn/py3/sklearn/cluster/_feature_agglomeration.py
imports: import warnings
  import numpy
  from scipy.sparse import issparse
  from ..base import TransformerMixin
  from ..utils import metadata_routing
  from ..utils.validation import check_is_fitted
label_desc: Use image node_id 1 for calling the AgglomerationTransform obj's underlying member method code with example usage: obj.transform(X) and returns: nX