class_docstr: Spectral embedding for non-linear dimensionality reduction.
  
  Forms an affinity matrix given by the specified function and
  applies spectral decomposition to the corresponding graph laplacian.
  The resulting transformation is given by the value of the
  eigenvectors for each data point.
  
  Note : Laplacian Eigenmaps is the actual algorithm implemented here.
  
  Read more in the :ref:`User Guide <spectral_embedding>`.
  
  Parameters
  ----------
  n_components : int, default=2
      The dimension of the projected subspace.
  
  affinity : {'nearest_neighbors', 'rbf', 'precomputed',                 'precomputed_nearest_neighbors'} or callable,                 default='nearest_neighbors'
      How to construct the affinity matrix.
       - 'nearest_neighbors' : construct the affinity matrix by computing a
         graph of nearest neighbors.
       - 'rbf' : construct the affinity matrix by computing a radial basis
         function (RBF) kernel.
       - 'precomputed' : interpret ``X`` as a precomputed affinity matrix.
       - 'precomputed_nearest_neighbors' : interpret ``X`` as a sparse graph
         of precomputed nearest neighbors, and constructs the affinity matrix
         by selecting the ``n_neighbors`` nearest neighbors.
       - callable : use passed in function as affinity
         the function takes in data matrix (n_samples, n_features)
         and return affinity matrix (n_samples, n_samples).
  
  gamma : float, default=None
      Kernel coefficient for rbf kernel. If None, gamma will be set to
      1/n_features.
  
  random_state : int, RandomState instance or None, default=None
      A pseudo random number generator used for the initialization
      of the lobpcg eigen vectors decomposition when `eigen_solver ==
      'amg'`, and for the K-Means initialization. Use an int to make
      the results deterministic across calls (See
      :term:`Glossary <random_state>`).
  
      .. note::
          When using `eigen_solver == 'amg'`,
          it is necessary to also fix the global numpy seed with
          `np.random.seed(int)` to get deterministic results. See
          https://github.com/pyamg/pyamg/issues/139 for further
          information.
  
  eigen_solver : {'arpack', 'lobpcg', 'amg'}, default=None
      The eigenvalue decomposition strategy to use. AMG requires pyamg
      to be installed. It can be faster on very large, sparse problems.
      If None, then ``'arpack'`` is used.
  
  eigen_tol : float, default="auto"
      Stopping criterion for eigendecomposition of the Laplacian matrix.
      If `eigen_tol="auto"` then the passed tolerance will depend on the
      `eigen_solver`:
  
      - If `eigen_solver="arpack"`, then `eigen_tol=0.0`;
      - If `eigen_solver="lobpcg"` or `eigen_solver="amg"`, then
        `eigen_tol=None` which configures the underlying `lobpcg` solver to
        automatically resolve the value according to their heuristics. See,
        :func:`scipy.sparse.linalg.lobpcg` for details.
  
      Note that when using `eigen_solver="lobpcg"` or `eigen_solver="amg"`
      values of `tol<1e-5` may lead to convergence issues and should be
      avoided.
  
      .. versionadded:: 1.2
  
  n_neighbors : int, default=None
      Number of nearest neighbors for nearest_neighbors graph building.
      If None, n_neighbors will be set to max(n_samples/10, 1).
  
  n_jobs : int, 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.
  
  Attributes
  ----------
  embedding_ : ndarray of shape (n_samples, n_components)
      Spectral embedding of the training matrix.
  
  affinity_matrix_ : ndarray of shape (n_samples, n_samples)
      Affinity_matrix constructed from samples or precomputed.
  
  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
  
  n_neighbors_ : int
      Number of nearest neighbors effectively used.
  
  See Also
  --------
  Isomap : Non-linear dimensionality reduction through Isometric Mapping.
  
  References
  ----------
  
  - :doi:`A Tutorial on Spectral Clustering, 2007
    Ulrike von Luxburg
    <10.1007/s11222-007-9033-z>`
  
  - `On Spectral Clustering: Analysis and an algorithm, 2001
    Andrew Y. Ng, Michael I. Jordan, Yair Weiss
    <https://citeseerx.ist.psu.edu/doc_view/pid/796c5d6336fc52aa84db575fb821c78918b65f58>`_
  
  - :doi:`Normalized cuts and image segmentation, 2000
    Jianbo Shi, Jitendra Malik
    <10.1109/34.868688>`
  
  Examples
  --------
  >>> from sklearn.datasets import load_digits
  >>> from sklearn.manifold import SpectralEmbedding
  >>> X, _ = load_digits(return_X_y=True)
  >>> X.shape
  (1797, 64)
  >>> embedding = SpectralEmbedding(n_components=2)
  >>> X_transformed = embedding.fit_transform(X[:100])
  >>> X_transformed.shape
  (100, 2)
class_docstr_tok: ["Spectral","embedding","for","non-linear","dimensionality","reduction",".","Forms","an","affinity","matrix","given","by","the","specified","function","and","applies","spectral","decomposition","to","the","corresponding","graph","laplacian",".","The","resulting","transformation","is","given","by","the","value","of","the","eigenvectors","for","each","data","point",".","Note",":","Laplacian","Eigenmaps","is","the","actual","algorithm","implemented","here",".","Read","more","in","the",":","ref",":","`","User","Guide","<","spectral_embedding",">","`",".","Parameters","--","--","--","--","--","n_components",":","int",",","default=2","The","dimension","of","the","projected","subspace",".","affinity",":","{","'nearest_neighbors","'",",","'rbf","'",",","'precomputed","'",",","'precomputed_nearest_neighbors","'","}","or","callable",",","default='nearest_neighbors'","How","to","construct","the","affinity","matrix",".","-","'nearest_neighbors","'",":","construct","the","affinity","matrix","by","computing","a","graph","of","nearest","neighbors",".","-","'rbf","'",":","construct","the","affinity","matrix","by","computing","a","radial","basis","function","(","RBF",")","kernel",".","-","'precomputed","'",":","interpret","``","X","``","as","a","precomputed","affinity","matrix",".","-","'precomputed_nearest_neighbors","'",":","interpret","``","X","``","as","a","sparse","graph","of","precomputed","nearest","neighbors",",","and","constructs","the","affinity","matrix","by","selecting","the","``","n_neighbors","``","nearest","neighbors",".","-","callable",":","use","passed","in","function","as","affinity","the","function","takes","in","data","matrix","(","n_samples",",","n_features",")","and","return","affinity","matrix","(","n_samples",",","n_samples",")",".","gamma",":","float",",","default=None","Kernel","coefficient","for","rbf","kernel",".","If","None",",","gamma","will","be","set","to","1\/n_features",".","random_state",":","int",",","RandomState","instance","or","None",",","default=None","A","pseudo","random","number","generator","used","for","the","initialization","of","the","lobpcg","eigen","vectors","decomposition","when","`","eigen_solver","==","'amg","'","`",",","and","for","the","K-Means","initialization",".","Use","an","int","to","make","the","results","deterministic","across","calls","(","See",":","term",":","`","Glossary","<","random_state",">","`",")",".","..","note",":",":","When","using","`","eigen_solver","==","'amg","'","`",",","it","is","necessary","to","also","fix","the","global","numpy","seed","with","`","np.random.seed","(","int",")","`","to","get","deterministic","results",".","See","https",":","\/\/github.com\/pyamg\/pyamg\/issues\/139","for","further","information",".","eigen_solver",":","{","'arpack","'",",","'lobpcg","'",",","'amg","'","}",",","default=None","The","eigenvalue","decomposition","strategy","to","use",".","AMG","requires","pyamg","to","be","installed",".","It","can","be","faster","on","very","large",",","sparse","problems",".","If","None",",","then","``","'arpack","'","``","is","used",".","eigen_tol",":","float",",","default=","''","auto","''","Stopping","criterion","for","eigendecomposition","of","the","Laplacian","matrix",".","If","`","eigen_tol=","''","auto","''","`","then","the","passed","tolerance","will","depend","on","the","`","eigen_solver","`",":","-","If","`","eigen_solver=","''","arpack","''","`",",","then","`","eigen_tol=0.0","`",";","-","If","`","eigen_solver=","''","lobpcg","''","`","or","`","eigen_solver=","''","amg","''","`",",","then","`","eigen_tol=None","`","which","configures","the","underlying","`","lobpcg","`","solver","to","automatically","resolve","the","value","according","to","their","heuristics",".","See",",",":","func",":","`","scipy.sparse.linalg.lobpcg","`","for","details",".","Note","that","when","using","`","eigen_solver=","''","lobpcg","''","`","or","`","eigen_solver=","''","amg","''","`","values","of","`","tol","<","1e-5","`","may","lead","to","convergence","issues","and","should","be","avoided",".","..","versionadded",":",":","1.2","n_neighbors",":","int",",","default=None","Number","of","nearest","neighbors","for","nearest_neighbors","graph","building",".","If","None",",","n_neighbors","will","be","set","to","max","(","n_samples\/10",",","1",")",".","n_jobs",":","int",",","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",".","Attributes","--","--","--","--","--","embedding_",":","ndarray","of","shape","(","n_samples",",","n_components",")","Spectral","embedding","of","the","training","matrix",".","affinity_matrix_",":","ndarray","of","shape","(","n_samples",",","n_samples",")","Affinity_matrix","constructed","from","samples","or","precomputed",".","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","n_neighbors_",":","int","Number","of","nearest","neighbors","effectively","used",".","See","Also","--","--","--","--","Isomap",":","Non-linear","dimensionality","reduction","through","Isometric","Mapping",".","References","--","--","--","--","--","-",":","doi",":","`","A","Tutorial","on","Spectral","Clustering",",","2007","Ulrike","von","Luxburg","<","10.1007\/s11222-007-9033-z",">","`","-","`","On","Spectral","Clustering",":","Analysis","and","an","algorithm",",","2001","Andrew","Y.","Ng",",","Michael","I.","Jordan",",","Yair","Weiss","<","https",":","\/\/citeseerx.ist.psu.edu\/doc_view\/pid\/796c5d6336fc52aa84db575fb821c78918b65f58",">","`","_","-",":","doi",":","`","Normalized","cuts","and","image","segmentation",",","2000","Jianbo","Shi",",","Jitendra","Malik","<","10.1109\/34.868688",">","`","Examples","--","--","--","--",">",">",">","from","sklearn.datasets","import","load_digits",">",">",">","from","sklearn.manifold","import","SpectralEmbedding",">",">",">","X",",","_","=","load_digits","(","return_X_y=True",")",">",">",">","X.shape","(","1797",",","64",")",">",">",">","embedding","=","SpectralEmbedding","(","n_components=2",")",">",">",">","X_transformed","=","embedding.fit_transform","(","X","[",":100","]",")",">",">",">","X_transformed.shape","(","100",",","2",")"]
code: def __init__(
      self,
      n_components=2,
      *,
      affinity="nearest_neighbors",
      gamma=None,
      random_state=None,
      eigen_solver=None,
      eigen_tol="auto",
      n_neighbors=None,
      n_jobs=None,
  ):
      self.n_components = n_components
      self.affinity = affinity
      self.gamma = gamma
      self.random_state = random_state
      self.eigen_solver = eigen_solver
      self.eigen_tol = eigen_tol
      self.n_neighbors = n_neighbors
      self.n_jobs = n_jobs
  
imports: import warnings
  from numbers import Integral, Real
  import numpy
  from scipy import sparse
  from scipy.linalg import eigh
  from scipy.sparse.csgraph import connected_components
  from scipy.sparse.linalg import eigsh, lobpcg
  from ..base import BaseEstimator, _fit_context
  from ..metrics.pairwise import rbf_kernel
  from ..neighbors import NearestNeighbors, kneighbors_graph
  from ..utils import check_array, check_random_state, check_symmetric
  from ..utils._arpack import _init_arpack_v0
  from ..utils._param_validation import Interval, StrOptions
  from ..utils.extmath import _deterministic_vector_sign_flip
  from ..utils.fixes import laplacian
  from ..utils.fixes import parse_version, sp_version
label_desc: Use image node_id 1 to create a new SpectralEmbedding object from inherited base classes: BaseEstimator with example: obj = SpectralEmbedding(n_components)