class_docstr: The Manifold visualizer provides high dimensional visualization for feature
  analysis by embedding data into 2 dimensions using the sklearn.manifold
  package for manifold learning. In brief, manifold learning algorithms are
  unsuperivsed approaches to non-linear dimensionality reduction (unlike PCA
  or SVD) that help visualize latent structures in data.
  
  The manifold algorithm used to do the embedding in scatter plot space can
  either be a transformer or a string representing one of the already
  specified manifolds as follows:
  
      ============== ==========================
      Manifold       Description
      -------------- --------------------------
      ``"lle"``      `Locally Linear Embedding`_
      ``"ltsa"``     `LTSA LLE`_
      ``"hessian"``  `Hessian LLE`_
      ``"modified"`` `Modified LLE`_
      ``"isomap"``   `Isomap`_
      ``"mds"``      `Multi-Dimensional Scaling`_
      ``"spectral"`` `Spectral Embedding`_
      ``"tsne"``     `t-SNE`_
      ============== ==========================
  
  Each of these algorithms embeds non-linear relationships in different ways,
  allowing for an exploration of various structures in the feature space.
  Note however, that each of these algorithms has different time, memory and
  complexity requirements; take special care when using large datasets!
  
  The Manifold visualizer also shows the specified target (if given) as the
  color of the scatter plot. If a classification or clustering target is
  given, then discrete colors will be used with a legend. If a regression or
  continuous target is specified, then a colormap and colorbar will be shown.
  
  Parameters
  ----------
  ax : matplotlib Axes, default: None
      The axes to plot the figure on. If None, the current axes will be used
      or generated if required.
  
  manifold : str or Transformer, default: "mds"
      Specify the manifold algorithm to perform the embedding. Either one of
      the strings listed in the table above, or an actual scikit-learn
      transformer. The constructed manifold is accessible with the manifold
      property, so as to modify hyperparameters before fit.
  
  n_neighbors : int, default: None
      Many manifold algorithms are nearest neighbors based, for those that
      are, this parameter specfies the number of neighbors to use in the
      embedding. If n_neighbors is not specified for those embeddings, it is
      set to 5 and a warning is issued. If the manifold algorithm doesn't use
      nearest neighbors, then this parameter is ignored.
  
  features : list, default: None
      The names of the features specified by the columns of the input dataset.
      This length of this list must match the number of columns in X, otherwise
      an exception will be raised on ``fit()``.
  
  classes : list, default: None
      The class labels for each class in y, ordered by sorted class index. These
      names act as a label encoder for the legend, identifying integer classes
      or renaming string labels. If omitted, the class labels will be taken from
      the unique values in y.
  
      Note that the length of this list must match the number of unique values in
      y, otherwise an exception is raised. This parameter is only used in the
      discrete target type case and is ignored otherwise.
  
  colors : list or tuple, default: None
      A single color to plot all instances as or a list of colors to color each
      instance according to its class in the discrete case or as an ordered
      colormap in the sequential case. If not enough colors per class are
      specified then the colors are treated as a cycle.
  
  colormap : string or cmap, default: None
      The colormap used to create the individual colors. In the discrete case
      it is used to compute the number of colors needed for each class and
      in the continuous case it is used to create a sequential color map based
      on the range of the target.
  
  target_type : str, default: "auto"
      Specify the type of target as either "discrete" (classes) or "continuous"
      (real numbers, usually for regression). If "auto", then it will
      attempt to determine the type by counting the number of unique values.
  
      If the target is discrete, the colors are returned as a dict with classes
      being the keys. If continuous the colors will be list having value of
      color for each point. In either case, if no target is specified, then
      color will be specified as the first color in the color cycle.
  
  projection : int or string, default: 2
      The number of axes to project into, either 2d or 3d. To plot 3d plots
      with matplotlib, please ensure a 3d axes is passed to the visualizer,
      otherwise one will be created using the current figure.
  
  alpha : float, default: 0.75
      Specify a transparency where 1 is completely opaque and 0 is completely
      transparent. This property makes densely clustered points more visible.
  
  random_state : int or RandomState, default: None
      Fixes the random state for stochastic manifold algorithms.
  
  colorbar : bool, default: True
      If the target_type is "continous" draw a colorbar to the right of the
      scatter plot. The colobar axes is accessible using the cax property.
  
  kwargs : dict
      Keyword arguments passed to the base class and may influence the
      feature visualization properties.
  
  Attributes
  ----------
  fit_time_ : yellowbrick.utils.timer.Timer
      The amount of time in seconds it took to fit the Manifold.
  
  classes_ : ndarray, shape (n_classes,)
      The class labels that define the discrete values in the target. Only
      available if the target type is discrete. This is guaranteed to be
      strings even if the classes are a different type.
  
  features_ : ndarray, shape (n_features,)
      The names of the features discovered or used in the visualizer that
      can be used as an index to access or modify data in X. If a user passes
      feature names in, those features are used. Otherwise the columns of a
      DataFrame are used or just simply the indices of the data array.
  
  range_ : (min y, max y)
      A tuple that describes the minimum and maximum values in the target.
      Only available if the target type is continuous.
  
  Examples
  --------
  
  >>> viz = Manifold(manifold='isomap', target='discrete')
  >>> viz.fit_transform(X, y)
  >>> viz.show()
  
  Notes
  -----
  Specifying the target as ``'continuous'`` or ``'discrete'`` will influence
  how the visualizer is finally displayed, don't rely on the automatic
  determination from the Manifold!
  
  Scaling your data with the standard scalar before applying it to the
  visualizer is a great way of increasing performance. Additionally using
  the ``SelectKBest`` transformer may also improve performance and lead to
  better visualizations.
  
  .. warning::
      Manifold visualizers have extremly varying time, resource, and
      complexity requirements. Sampling data or features may be necessary
      in order to finish a manifold computation.
  
  .. seealso::
      The Scikit-Learn discussion on `Manifold Learning <http://scikit-learn.org/stable/modules/manifold.html>`_.
  
  .. _`Locally Linear Embedding`: http://scikit-learn.org/stable/modules/manifold.html#locally-linear-embedding
  .. _`LTSA LLE`: http://scikit-learn.org/stable/modules/manifold.html#local-tangent-space-alignment
  .. _`Hessian LLE`: http://scikit-learn.org/stable/modules/manifold.html#hessian-eigenmapping
  .. _`Modified LLE`: http://scikit-learn.org/stable/modules/manifold.html#modified-locally-linear-embedding
  .. _`Isomap`: http://scikit-learn.org/stable/modules/manifold.html#isomap
  .. _`Multi-Dimensional Scaling`: http://scikit-learn.org/stable/modules/manifold.html#multi-dimensional-scaling-mds
  .. _`Spectral Embedding`: http://scikit-learn.org/stable/modules/manifold.html#spectral-embedding
  .. _`t-SNE`: http://scikit-learn.org/stable/modules/manifold.html#t-distributed-stochastic-neighbor-embedding-t-sne
class_docstr_tok: ["The","Manifold","visualizer","provides","high","dimensional","visualization","for","feature","analysis","by","embedding","data","into","2","dimensions","using","the","sklearn.manifold","package","for","manifold","learning",".","In","brief",",","manifold","learning","algorithms","are","unsuperivsed","approaches","to","non-linear","dimensionality","reduction","(","unlike","PCA","or","SVD",")","that","help","visualize","latent","structures","in","data",".","The","manifold","algorithm","used","to","do","the","embedding","in","scatter","plot","space","can","either","be","a","transformer","or","a","string","representing","one","of","the","already","specified","manifolds","as","follows",":","==============","==========================","Manifold","Description","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","``","``","lle","''","``","`","Locally","Linear","Embedding","`","_","``","``","ltsa","''","``","`","LTSA","LLE","`","_","``","``","hessian","''","``","`","Hessian","LLE","`","_","``","``","modified","''","``","`","Modified","LLE","`","_","``","``","isomap","''","``","`","Isomap","`","_","``","``","mds","''","``","`","Multi-Dimensional","Scaling","`","_","``","``","spectral","''","``","`","Spectral","Embedding","`","_","``","``","tsne","''","``","`","t-SNE","`","_","==============","==========================","Each","of","these","algorithms","embeds","non-linear","relationships","in","different","ways",",","allowing","for","an","exploration","of","various","structures","in","the","feature","space",".","Note","however",",","that","each","of","these","algorithms","has","different","time",",","memory","and","complexity","requirements",";","take","special","care","when","using","large","datasets","!","The","Manifold","visualizer","also","shows","the","specified","target","(","if","given",")","as","the","color","of","the","scatter","plot",".","If","a","classification","or","clustering","target","is","given",",","then","discrete","colors","will","be","used","with","a","legend",".","If","a","regression","or","continuous","target","is","specified",",","then","a","colormap","and","colorbar","will","be","shown",".","Parameters","--","--","--","--","--","ax",":","matplotlib","Axes",",","default",":","None","The","axes","to","plot","the","figure","on",".","If","None",",","the","current","axes","will","be","used","or","generated","if","required",".","manifold",":","str","or","Transformer",",","default",":","``","mds","''","Specify","the","manifold","algorithm","to","perform","the","embedding",".","Either","one","of","the","strings","listed","in","the","table","above",",","or","an","actual","scikit-learn","transformer",".","The","constructed","manifold","is","accessible","with","the","manifold","property",",","so","as","to","modify","hyperparameters","before","fit",".","n_neighbors",":","int",",","default",":","None","Many","manifold","algorithms","are","nearest","neighbors","based",",","for","those","that","are",",","this","parameter","specfies","the","number","of","neighbors","to","use","in","the","embedding",".","If","n_neighbors","is","not","specified","for","those","embeddings",",","it","is","set","to","5","and","a","warning","is","issued",".","If","the","manifold","algorithm","does","n't","use","nearest","neighbors",",","then","this","parameter","is","ignored",".","features",":","list",",","default",":","None","The","names","of","the","features","specified","by","the","columns","of","the","input","dataset",".","This","length","of","this","list","must","match","the","number","of","columns","in","X",",","otherwise","an","exception","will","be","raised","on","``","fit","(",")","``",".","classes",":","list",",","default",":","None","The","class","labels","for","each","class","in","y",",","ordered","by","sorted","class","index",".","These","names","act","as","a","label","encoder","for","the","legend",",","identifying","integer","classes","or","renaming","string","labels",".","If","omitted",",","the","class","labels","will","be","taken","from","the","unique","values","in","y",".","Note","that","the","length","of","this","list","must","match","the","number","of","unique","values","in","y",",","otherwise","an","exception","is","raised",".","This","parameter","is","only","used","in","the","discrete","target","type","case","and","is","ignored","otherwise",".","colors",":","list","or","tuple",",","default",":","None","A","single","color","to","plot","all","instances","as","or","a","list","of","colors","to","color","each","instance","according","to","its","class","in","the","discrete","case","or","as","an","ordered","colormap","in","the","sequential","case",".","If","not","enough","colors","per","class","are","specified","then","the","colors","are","treated","as","a","cycle",".","colormap",":","string","or","cmap",",","default",":","None","The","colormap","used","to","create","the","individual","colors",".","In","the","discrete","case","it","is","used","to","compute","the","number","of","colors","needed","for","each","class","and","in","the","continuous","case","it","is","used","to","create","a","sequential","color","map","based","on","the","range","of","the","target",".","target_type",":","str",",","default",":","``","auto","''","Specify","the","type","of","target","as","either","``","discrete","''","(","classes",")","or","``","continuous","''","(","real","numbers",",","usually","for","regression",")",".","If","``","auto","''",",","then","it","will","attempt","to","determine","the","type","by","counting","the","number","of","unique","values",".","If","the","target","is","discrete",",","the","colors","are","returned","as","a","dict","with","classes","being","the","keys",".","If","continuous","the","colors","will","be","list","having","value","of","color","for","each","point",".","In","either","case",",","if","no","target","is","specified",",","then","color","will","be","specified","as","the","first","color","in","the","color","cycle",".","projection",":","int","or","string",",","default",":","2","The","number","of","axes","to","project","into",",","either","2d","or","3d",".","To","plot","3d","plots","with","matplotlib",",","please","ensure","a","3d","axes","is","passed","to","the","visualizer",",","otherwise","one","will","be","created","using","the","current","figure",".","alpha",":","float",",","default",":","0.75","Specify","a","transparency","where","1","is","completely","opaque","and","0","is","completely","transparent",".","This","property","makes","densely","clustered","points","more","visible",".","random_state",":","int","or","RandomState",",","default",":","None","Fixes","the","random","state","for","stochastic","manifold","algorithms",".","colorbar",":","bool",",","default",":","True","If","the","target_type","is","``","continous","''","draw","a","colorbar","to","the","right","of","the","scatter","plot",".","The","colobar","axes","is","accessible","using","the","cax","property",".","kwargs",":","dict","Keyword","arguments","passed","to","the","base","class","and","may","influence","the","feature","visualization","properties",".","Attributes","--","--","--","--","--","fit_time_",":","yellowbrick.utils.timer.Timer","The","amount","of","time","in","seconds","it","took","to","fit","the","Manifold",".","classes_",":","ndarray",",","shape","(","n_classes",",",")","The","class","labels","that","define","the","discrete","values","in","the","target",".","Only","available","if","the","target","type","is","discrete",".","This","is","guaranteed","to","be","strings","even","if","the","classes","are","a","different","type",".","features_",":","ndarray",",","shape","(","n_features",",",")","The","names","of","the","features","discovered","or","used","in","the","visualizer","that","can","be","used","as","an","index","to","access","or","modify","data","in","X",".","If","a","user","passes","feature","names","in",",","those","features","are","used",".","Otherwise","the","columns","of","a","DataFrame","are","used","or","just","simply","the","indices","of","the","data","array",".","range_",":","(","min","y",",","max","y",")","A","tuple","that","describes","the","minimum","and","maximum","values","in","the","target",".","Only","available","if","the","target","type","is","continuous",".","Examples","--","--","--","--",">",">",">","viz","=","Manifold","(","manifold='isomap","'",",","target='discrete","'",")",">",">",">","viz.fit_transform","(","X",",","y",")",">",">",">","viz.show","(",")","Notes","--","--","-","Specifying","the","target","as","``","'continuous","'","``","or","``","'discrete","'","``","will","influence","how","the","visualizer","is","finally","displayed",",","do","n't","rely","on","the","automatic","determination","from","the","Manifold","!","Scaling","your","data","with","the","standard","scalar","before","applying","it","to","the","visualizer","is","a","great","way","of","increasing","performance",".","Additionally","using","the","``","SelectKBest","``","transformer","may","also","improve","performance","and","lead","to","better","visualizations",".","..","warning",":",":","Manifold","visualizers","have","extremly","varying","time",",","resource",",","and","complexity","requirements",".","Sampling","data","or","features","may","be","necessary","in","order","to","finish","a","manifold","computation",".","..","seealso",":",":","The","Scikit-Learn","discussion","on","`","Manifold","Learning","<","http",":","\/\/scikit-learn.org\/stable\/modules\/manifold.html",">","`","_",".","..","_","`","Locally","Linear","Embedding","`",":","http",":","\/\/scikit-learn.org\/stable\/modules\/manifold.html","#","locally-linear-embedding","..","_","`","LTSA","LLE","`",":","http",":","\/\/scikit-learn.org\/stable\/modules\/manifold.html","#","local-tangent-space-alignment","..","_","`","Hessian","LLE","`",":","http",":","\/\/scikit-learn.org\/stable\/modules\/manifold.html","#","hessian-eigenmapping","..","_","`","Modified","LLE","`",":","http",":","\/\/scikit-learn.org\/stable\/modules\/manifold.html","#","modified-locally-linear-embedding","..","_","`","Isomap","`",":","http",":","\/\/scikit-learn.org\/stable\/modules\/manifold.html","#","isomap","..","_","`","Multi-Dimensional","Scaling","`",":","http",":","\/\/scikit-learn.org\/stable\/modules\/manifold.html","#","multi-dimensional-scaling-mds","..","_","`","Spectral","Embedding","`",":","http",":","\/\/scikit-learn.org\/stable\/modules\/manifold.html","#","spectral-embedding","..","_","`","t-SNE","`",":","http",":","\/\/scikit-learn.org\/stable\/modules\/manifold.html","#","t-distributed-stochastic-neighbor-embedding-t-sne"]
docstr: Add title and modify axes to make the image ready for display.
docstr_tok: ["Add","title","and","modify","axes","to","make","the","image","ready","for","display","."]
code: def finalize(self):
      """
      Add title and modify axes to make the image ready for display.
      """
      self.set_title(
          "{} Manifold (fit in {:0.2f} seconds)".format(
              self._name, self.fit_time_.interval
          )
      )
      self.ax.set_xlabel(
          "Using {} features".format(len(self.features_))
      )
      # Draws legend for discrete target and colorbar for continuous.
      super(Manifold, self).finalize()
  
imports: import warnings
  from yellowbrick.utils.timer import Timer
  from yellowbrick.utils.types import is_estimator
  from yellowbrick.exceptions import ModelError, NotFitted
  from yellowbrick.features.projection import ProjectionVisualizer
  from yellowbrick.exceptions import YellowbrickValueError, YellowbrickWarning
  from sklearn.base import clone
  from sklearn.exceptions import NotFittedError
  from sklearn.manifold import LocallyLinearEmbedding
  from sklearn.manifold import Isomap, MDS, TSNE, SpectralEmbedding
label_desc: Use image node_id 8 for calling the Manifold obj's underlying member method code with example usage: obj.finalize() without return types