class_docstr: Isomap Embedding.
  
  Non-linear dimensionality reduction through Isometric Mapping
  
  Read more in the :ref:`User Guide <isomap>`.
  
  Parameters
  ----------
  n_neighbors : int or None, default=5
      Number of neighbors to consider for each point. If `n_neighbors` is an int,
      then `radius` must be `None`.
  
  radius : float or None, default=None
      Limiting distance of neighbors to return. If `radius` is a float,
      then `n_neighbors` must be set to `None`.
  
      .. versionadded:: 1.1
  
  n_components : int, default=2
      Number of coordinates for the manifold.
  
  eigen_solver : {'auto', 'arpack', 'dense'}, default='auto'
      'auto' : Attempt to choose the most efficient solver
      for the given problem.
  
      'arpack' : Use Arnoldi decomposition to find the eigenvalues
      and eigenvectors.
  
      'dense' : Use a direct solver (i.e. LAPACK)
      for the eigenvalue decomposition.
  
  tol : float, default=0
      Convergence tolerance passed to arpack or lobpcg.
      not used if eigen_solver == 'dense'.
  
  max_iter : int, default=None
      Maximum number of iterations for the arpack solver.
      not used if eigen_solver == 'dense'.
  
  path_method : {'auto', 'FW', 'D'}, default='auto'
      Method to use in finding shortest path.
  
      'auto' : attempt to choose the best algorithm automatically.
  
      'FW' : Floyd-Warshall algorithm.
  
      'D' : Dijkstra's algorithm.
  
  neighbors_algorithm : {'auto', 'brute', 'kd_tree', 'ball_tree'},                           default='auto'
      Algorithm to use for nearest neighbors search,
      passed to neighbors.NearestNeighbors instance.
  
  n_jobs : int or None, default=None
      The number of parallel jobs to run.
      ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context.
      ``-1`` means using all processors. See :term:`Glossary <n_jobs>`
      for more details.
  
  metric : str, or callable, default="minkowski"
      The metric to use when calculating distance between instances in a
      feature array. If metric is a string or callable, it must be one of
      the options allowed by :func:`sklearn.metrics.pairwise_distances` for
      its metric parameter.
      If metric is "precomputed", X is assumed to be a distance matrix and
      must be square. X may be a :term:`Glossary <sparse graph>`.
  
      .. versionadded:: 0.22
  
  p : float, default=2
      Parameter for the Minkowski metric from
      sklearn.metrics.pairwise.pairwise_distances. When p = 1, this is
      equivalent to using manhattan_distance (l1), and euclidean_distance
      (l2) for p = 2. For arbitrary p, minkowski_distance (l_p) is used.
  
      .. versionadded:: 0.22
  
  metric_params : dict, default=None
      Additional keyword arguments for the metric function.
  
      .. versionadded:: 0.22
  
  Attributes
  ----------
  embedding_ : array-like, shape (n_samples, n_components)
      Stores the embedding vectors.
  
  kernel_pca_ : object
      :class:`~sklearn.decomposition.KernelPCA` object used to implement the
      embedding.
  
  nbrs_ : sklearn.neighbors.NearestNeighbors instance
      Stores nearest neighbors instance, including BallTree or KDtree
      if applicable.
  
  dist_matrix_ : array-like, shape (n_samples, n_samples)
      Stores the geodesic distance matrix of training data.
  
  n_features_in_ : int
      Number of features seen during :term:`fit`.
  
      .. versionadded:: 0.24
  
  feature_names_in_ : ndarray of shape (`n_features_in_`,)
      Names of features seen during :term:`fit`. Defined only when `X`
      has feature names that are all strings.
  
      .. versionadded:: 1.0
  
  See Also
  --------
  sklearn.decomposition.PCA : Principal component analysis that is a linear
      dimensionality reduction method.
  sklearn.decomposition.KernelPCA : Non-linear dimensionality reduction using
      kernels and PCA.
  MDS : Manifold learning using multidimensional scaling.
  TSNE : T-distributed Stochastic Neighbor Embedding.
  LocallyLinearEmbedding : Manifold learning using Locally Linear Embedding.
  SpectralEmbedding : Spectral embedding for non-linear dimensionality.
  
  References
  ----------
  
  .. [1] Tenenbaum, J.B.; De Silva, V.; & Langford, J.C. A global geometric
         framework for nonlinear dimensionality reduction. Science 290 (5500)
  
  Examples
  --------
  >>> from sklearn.datasets import load_digits
  >>> from sklearn.manifold import Isomap
  >>> X, _ = load_digits(return_X_y=True)
  >>> X.shape
  (1797, 64)
  >>> embedding = Isomap(n_components=2)
  >>> X_transformed = embedding.fit_transform(X[:100])
  >>> X_transformed.shape
  (100, 2)
code: def _fit_transform(self, X):
      if self.n_neighbors is not None and self.radius is not None:
          raise ValueError(
              "Both n_neighbors and radius are provided. Use"
              f" Isomap(radius={self.radius}, n_neighbors=None) if intended to use"
              " radius-based neighbors"
          )
  
      self.nbrs_ = NearestNeighbors(
          n_neighbors=self.n_neighbors,
          radius=self.radius,
          algorithm=self.neighbors_algorithm,
          metric=self.metric,
          p=self.p,
          metric_params=self.metric_params,
          n_jobs=self.n_jobs,
      )
      self.nbrs_.fit(X)
      self.n_features_in_ = self.nbrs_.n_features_in_
      if hasattr(self.nbrs_, "feature_names_in_"):
          self.feature_names_in_ = self.nbrs_.feature_names_in_
  
      self.kernel_pca_ = KernelPCA(
          n_components=self.n_components,
          kernel="precomputed",
          eigen_solver=self.eigen_solver,
          tol=self.tol,
          max_iter=self.max_iter,
          n_jobs=self.n_jobs,
      ).set_output(transform="default")
  
      if self.n_neighbors is not None:
          nbg = kneighbors_graph(
              self.nbrs_,
              self.n_neighbors,
              metric=self.metric,
              p=self.p,
              metric_params=self.metric_params,
              mode="distance",
              n_jobs=self.n_jobs,
          )
      else:
          nbg = radius_neighbors_graph(
              self.nbrs_,
              radius=self.radius,
              metric=self.metric,
              p=self.p,
              metric_params=self.metric_params,
              mode="distance",
              n_jobs=self.n_jobs,
          )
  
      # Compute the number of connected components, and connect the different
      # components to be able to compute a shortest path between all pairs
      # of samples in the graph.
      # Similar fix to cluster._agglomerative._fix_connectivity.
      n_connected_components, labels = connected_components(nbg)
      if n_connected_components > 1:
          if self.metric == "precomputed" and issparse(X):
              raise RuntimeError(
                  "The number of connected components of the neighbors graph"
                  f" is {n_connected_components} > 1. The graph cannot be "
                  "completed with metric='precomputed', and Isomap cannot be"
                  "fitted. Increase the number of neighbors to avoid this "
                  "issue, or precompute the full distance matrix instead "
                  "of passing a sparse neighbors graph."
              )
          warnings.warn(
              (
                  "The number of connected components of the neighbors graph "
                  f"is {n_connected_components} > 1. Completing the graph to fit"
                  " Isomap might be slow. Increase the number of neighbors to "
                  "avoid this issue."
              ),
              stacklevel=2,
          )
  
          # use array validated by NearestNeighbors
          nbg = _fix_connected_components(
              X=self.nbrs_._fit_X,
              graph=nbg,
              n_connected_components=n_connected_components,
              component_labels=labels,
              mode="distance",
              metric=self.nbrs_.effective_metric_,
              **self.nbrs_.effective_metric_params_,
          )
  
      self.dist_matrix_ = shortest_path(
          nbg, method=self.path_method, directed=False
      )
  
      if self.nbrs_._fit_X.dtype == np.float32:
          self.dist_matrix_ = self.dist_matrix_.astype(
              self.nbrs_._fit_X.dtype, copy=False
          )
  
      G = self.dist_matrix_**2
      G *= -0.5
  
      self.embedding_ = self.kernel_pca_.fit_transform(G)
      self._n_features_out = self.embedding_.shape[1]
  
imports: import warnings
  from numbers import Integral, Real
  import numpy
  from scipy.sparse import issparse
  from scipy.sparse.csgraph import connected_components, shortest_path
  from ..base import BaseEstimator, ClassNamePrefixFeaturesOutMixin, TransformerMixin, _fit_context
  from ..decomposition import KernelPCA
  from ..metrics.pairwise import _VALID_METRICS
  from ..neighbors import NearestNeighbors, kneighbors_graph, radius_neighbors_graph
  from ..preprocessing import KernelCenterer
  from ..utils._param_validation import Interval, StrOptions
  from ..utils.graph import _fix_connected_components
  from ..utils.validation import check_is_fitted
label_desc: Use image node_id 2 for calling the Isomap obj's underlying member method code with example usage: obj._fit_transform(X) without return types