def METHOD_NAME(self, X):
    """Transform X.
    This is implemented by linking the points X into the graph of geodesic
    distances of the training data. First the `n_neighbors` nearest
    neighbors of X are found in the training data, and from these the
    shortest geodesic distances from each point in X to each point in
    the training data are computed in order to construct the kernel.
    The embedding of X is the projection of this kernel onto the
    embedding vectors of the training set.
    Parameters
    ----------
    X: array-like, shape (n_samples, n_features)
    Returns
    -------
    X_new: array-like, shape (n_samples, n_components)
    """
    X = check_array(X)
    distances, indices = self.nbrs_.kneighbors(X, return_distance=True)
    # Create the graph of shortest distances from X to self.training_data_
    # via the nearest neighbors of X.
    # This can be done as a single array operation, but it potentially
    # takes a lot of memory.  To avoid that, use a loop:
    G_X = np.zeros((X.shape[0], self.training_data_.shape[0]))
    for i in range(X.shape[0]):
        G_X[i] = np.min(self.dist_matrix_[indices[i]] +
                        distances[i][:, None], 0)
    G_X **= 2
    G_X *= -0.5
    return self.kernel_pca_.METHOD_NAME(G_X)