class_docstr: Multidimensional scaling.
  
  Read more in the :ref:`User Guide <multidimensional_scaling>`.
  
  Parameters
  ----------
  n_components : int, default=2
      Number of dimensions in which to immerse the dissimilarities.
  
  metric : bool, default=True
      If ``True``, perform metric MDS; otherwise, perform nonmetric MDS.
      When ``False`` (i.e. non-metric MDS), dissimilarities with 0 are considered as
      missing values.
  
  n_init : int, default=4
      Number of times the SMACOF algorithm will be run with different
      initializations. The final results will be the best output of the runs,
      determined by the run with the smallest final stress.
  
  max_iter : int, default=300
      Maximum number of iterations of the SMACOF algorithm for a single run.
  
  verbose : int, default=0
      Level of verbosity.
  
  eps : float, default=1e-3
      Relative tolerance with respect to stress at which to declare
      convergence. The value of `eps` should be tuned separately depending
      on whether or not `normalized_stress` is being used.
  
  n_jobs : int, default=None
      The number of jobs to use for the computation. If multiple
      initializations are used (``n_init``), each run of the algorithm is
      computed in parallel.
  
      ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context.
      ``-1`` means using all processors. See :term:`Glossary <n_jobs>`
      for more details.
  
  random_state : int, RandomState instance or None, default=None
      Determines the random number generator used to initialize the centers.
      Pass an int for reproducible results across multiple function calls.
      See :term:`Glossary <random_state>`.
  
  dissimilarity : {'euclidean', 'precomputed'}, default='euclidean'
      Dissimilarity measure to use:
  
      - 'euclidean':
          Pairwise Euclidean distances between points in the dataset.
  
      - 'precomputed':
          Pre-computed dissimilarities are passed directly to ``fit`` and
          ``fit_transform``.
  
  normalized_stress : bool or "auto" default=False
      Whether use and return normed stress value (Stress-1) instead of raw
      stress calculated by default. Only supported in non-metric MDS.
  
      .. versionadded:: 1.2
  
  Attributes
  ----------
  embedding_ : ndarray of shape (n_samples, n_components)
      Stores the position of the dataset in the embedding space.
  
  stress_ : float
      The final value of the stress (sum of squared distance of the
      disparities and the distances for all constrained points).
      If `normalized_stress=True`, and `metric=False` returns Stress-1.
      A value of 0 indicates "perfect" fit, 0.025 excellent, 0.05 good,
      0.1 fair, and 0.2 poor [1]_.
  
  dissimilarity_matrix_ : ndarray of shape (n_samples, n_samples)
      Pairwise dissimilarities between the points. Symmetric matrix that:
  
      - either uses a custom dissimilarity matrix by setting `dissimilarity`
        to 'precomputed';
      - or constructs a dissimilarity matrix from data using
        Euclidean distances.
  
  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_iter_ : int
      The number of iterations corresponding to the best stress.
  
  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.
  TSNE : T-distributed Stochastic Neighbor Embedding.
  Isomap : Manifold learning based on Isometric Mapping.
  LocallyLinearEmbedding : Manifold learning using Locally Linear Embedding.
  SpectralEmbedding : Spectral embedding for non-linear dimensionality.
  
  References
  ----------
  .. [1] "Nonmetric multidimensional scaling: a numerical method" Kruskal, J.
     Psychometrika, 29 (1964)
  
  .. [2] "Multidimensional scaling by optimizing goodness of fit to a nonmetric
     hypothesis" Kruskal, J. Psychometrika, 29, (1964)
  
  .. [3] "Modern Multidimensional Scaling - Theory and Applications" Borg, I.;
     Groenen P. Springer Series in Statistics (1997)
  
  Examples
  --------
  >>> from sklearn.datasets import load_digits
  >>> from sklearn.manifold import MDS
  >>> X, _ = load_digits(return_X_y=True)
  >>> X.shape
  (1797, 64)
  >>> embedding = MDS(n_components=2, normalized_stress='auto')
  >>> X_transformed = embedding.fit_transform(X[:100])
  >>> X_transformed.shape
  (100, 2)
class_docstr_tok: ["Multidimensional","scaling",".","Read","more","in","the",":","ref",":","`","User","Guide","<","multidimensional_scaling",">","`",".","Parameters","--","--","--","--","--","n_components",":","int",",","default=2","Number","of","dimensions","in","which","to","immerse","the","dissimilarities",".","metric",":","bool",",","default=True","If","``","True","``",",","perform","metric","MDS",";","otherwise",",","perform","nonmetric","MDS",".","When","``","False","``","(","i.e",".","non-metric","MDS",")",",","dissimilarities","with","0","are","considered","as","missing","values",".","n_init",":","int",",","default=4","Number","of","times","the","SMACOF","algorithm","will","be","run","with","different","initializations",".","The","final","results","will","be","the","best","output","of","the","runs",",","determined","by","the","run","with","the","smallest","final","stress",".","max_iter",":","int",",","default=300","Maximum","number","of","iterations","of","the","SMACOF","algorithm","for","a","single","run",".","verbose",":","int",",","default=0","Level","of","verbosity",".","eps",":","float",",","default=1e-3","Relative","tolerance","with","respect","to","stress","at","which","to","declare","convergence",".","The","value","of","`","eps","`","should","be","tuned","separately","depending","on","whether","or","not","`","normalized_stress","`","is","being","used",".","n_jobs",":","int",",","default=None","The","number","of","jobs","to","use","for","the","computation",".","If","multiple","initializations","are","used","(","``","n_init","``",")",",","each","run","of","the","algorithm","is","computed","in","parallel",".","``","None","``","means","1","unless","in","a",":","obj",":","`","joblib.parallel_backend","`","context",".","``","-1","``","means","using","all","processors",".","See",":","term",":","`","Glossary","<","n_jobs",">","`","for","more","details",".","random_state",":","int",",","RandomState","instance","or","None",",","default=None","Determines","the","random","number","generator","used","to","initialize","the","centers",".","Pass","an","int","for","reproducible","results","across","multiple","function","calls",".","See",":","term",":","`","Glossary","<","random_state",">","`",".","dissimilarity",":","{","'euclidean","'",",","'precomputed","'","}",",","default='euclidean'","Dissimilarity","measure","to","use",":","-","'euclidean","'",":","Pairwise","Euclidean","distances","between","points","in","the","dataset",".","-","'precomputed","'",":","Pre-computed","dissimilarities","are","passed","directly","to","``","fit","``","and","``","fit_transform","``",".","normalized_stress",":","bool","or","``","auto","''","default=False","Whether","use","and","return","normed","stress","value","(","Stress-1",")","instead","of","raw","stress","calculated","by","default",".","Only","supported","in","non-metric","MDS",".","..","versionadded",":",":","1.2","Attributes","--","--","--","--","--","embedding_",":","ndarray","of","shape","(","n_samples",",","n_components",")","Stores","the","position","of","the","dataset","in","the","embedding","space",".","stress_",":","float","The","final","value","of","the","stress","(","sum","of","squared","distance","of","the","disparities","and","the","distances","for","all","constrained","points",")",".","If","`","normalized_stress=True","`",",","and","`","metric=False","`","returns","Stress-1",".","A","value","of","0","indicates","``","perfect","''","fit",",","0.025","excellent",",","0.05","good",",","0.1","fair",",","and","0.2","poor","[","1","]","_.","dissimilarity_matrix_",":","ndarray","of","shape","(","n_samples",",","n_samples",")","Pairwise","dissimilarities","between","the","points",".","Symmetric","matrix","that",":","-","either","uses","a","custom","dissimilarity","matrix","by","setting","`","dissimilarity","`","to","'precomputed","'",";","-","or","constructs","a","dissimilarity","matrix","from","data","using","Euclidean","distances",".","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_iter_",":","int","The","number","of","iterations","corresponding","to","the","best","stress",".","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",".","TSNE",":","T-distributed","Stochastic","Neighbor","Embedding",".","Isomap",":","Manifold","learning","based","on","Isometric","Mapping",".","LocallyLinearEmbedding",":","Manifold","learning","using","Locally","Linear","Embedding",".","SpectralEmbedding",":","Spectral","embedding","for","non-linear","dimensionality",".","References","--","--","--","--","--","..","[","1","]","``","Nonmetric","multidimensional","scaling",":","a","numerical","method","''","Kruskal",",","J.","Psychometrika",",","29","(","1964",")","..","[","2","]","``","Multidimensional","scaling","by","optimizing","goodness","of","fit","to","a","nonmetric","hypothesis","''","Kruskal",",","J.","Psychometrika",",","29",",","(","1964",")","..","[","3","]","``","Modern","Multidimensional","Scaling","-","Theory","and","Applications","''","Borg",",","I.",";","Groenen","P.","Springer","Series","in","Statistics","(","1997",")","Examples","--","--","--","--",">",">",">","from","sklearn.datasets","import","load_digits",">",">",">","from","sklearn.manifold","import","MDS",">",">",">","X",",","_","=","load_digits","(","return_X_y=True",")",">",">",">","X.shape","(","1797",",","64",")",">",">",">","embedding","=","MDS","(","n_components=2",",","normalized_stress='auto","'",")",">",">",">","X_transformed","=","embedding.fit_transform","(","X","[",":100","]",")",">",">",">","X_transformed.shape","(","100",",","2",")"]
docstr: Compute the position of the points in the embedding space.
  
  Parameters
  ----------
  X : array-like of shape (n_samples, n_features) or                 (n_samples, n_samples)
      Input data. If ``dissimilarity=='precomputed'``, the input should
      be the dissimilarity matrix.
  
  y : Ignored
      Not used, present for API consistency by convention.
  
  init : ndarray of shape (n_samples, n_components), default=None
      Starting configuration of the embedding to initialize the SMACOF
      algorithm. By default, the algorithm is initialized with a randomly
      chosen array.
  
  Returns
  -------
  self : object
      Fitted estimator.
docstr_tok: ["Compute","the","position","of","the","points","in","the","embedding","space",".","Parameters","--","--","--","--","--","X",":","array-like","of","shape","(","n_samples",",","n_features",")","or","(","n_samples",",","n_samples",")","Input","data",".","If","``","dissimilarity=='precomputed","'","``",",","the","input","should","be","the","dissimilarity","matrix",".","y",":","Ignored","Not","used",",","present","for","API","consistency","by","convention",".","init",":","ndarray","of","shape","(","n_samples",",","n_components",")",",","default=None","Starting","configuration","of","the","embedding","to","initialize","the","SMACOF","algorithm",".","By","default",",","the","algorithm","is","initialized","with","a","randomly","chosen","array",".","Returns","--","--","--","-","self",":","object","Fitted","estimator","."]
code: def fit(self, X, y=None, init=None):
      """
          Compute the position of the points in the embedding space.
  
          Parameters
          ----------
          X : array-like of shape (n_samples, n_features) or \
                  (n_samples, n_samples)
              Input data. If ``dissimilarity=='precomputed'``, the input should
              be the dissimilarity matrix.
  
          y : Ignored
              Not used, present for API consistency by convention.
  
          init : ndarray of shape (n_samples, n_components), default=None
              Starting configuration of the embedding to initialize the SMACOF
              algorithm. By default, the algorithm is initialized with a randomly
              chosen array.
  
          Returns
          -------
          self : object
              Fitted estimator.
          """
      self.fit_transform(X, init=init)
      return self
  
file_path: catboost/contrib/python/scikit-learn/py3/sklearn/manifold/_mds.py
imports: import warnings
  from numbers import Integral, Real
  import numpy
  from joblib import effective_n_jobs
  from ..base import BaseEstimator, _fit_context
  from ..isotonic import IsotonicRegression
  from ..metrics import euclidean_distances
  from ..utils import check_array, check_random_state, check_symmetric
  from ..utils._param_validation import Hidden, Interval, StrOptions
  from ..utils.parallel import Parallel, delayed
label_desc: Use image node_id 3 for calling the MDS obj's underlying member method code with example usage: obj.fit(X, y, init) and returns: self