class_docstr: Display a projection of a vectorized corpus in two dimensions using UMAP (Uniform
  Manifold Approximation and Projection), a nonlinear dimensionality reduction method
  that is particularly well suited to embedding in two or three dimensions for
  visualization as a scatter plot. UMAP is a relatively new technique but is often
  used to visualize clusters or groups of data points and their relative proximities.
  It typically is fast, scalable, and can be applied directly to sparse matrices
  eliminating the need to run a ``TruncatedSVD`` as a pre-processing step.
  
  The current default for UMAP is Euclidean distance. Hellinger distance would be a
  more appropriate distance function to use with CountVectorize data. That will be
  released in a forthcoming version of UMAP. In the meantime cosine distance is likely
  a better text default that Euclidean and can be set using the keyword argument
  ``metric='cosine'``.
  
  For more, see https://github.com/lmcinnes/umap
  
  Parameters
  ----------
  
  ax : matplotlib axes
      The axes to plot the figure on.
  
  labels : list of strings
      The names of the classes in the target, used to create a legend.
      Labels must match names of classes in sorted order.
  
  colors : list or tuple of colors
      Specify the colors for each individual class
  
  colormap : string or matplotlib cmap
      Sequential colormap for continuous target
  
  random_state : int, RandomState instance or None, optional, default: None
      If int, random_state is the seed used by the random number generator;
      If RandomState instance, random_state is the random number generator;
      If None, the random number generator is the RandomState instance used
      by np.random. The random state is applied to the preliminary
      decomposition as well as UMAP.
  
  alpha : float, default: 0.7
      Specify a transparency where 1 is completely opaque and 0 is completely
      transparent. This property makes densely clustered points more visible.
  
  kwargs : dict
      Pass any additional keyword arguments to the UMAP transformer.
  
  Examples
  --------
  
  >>> model = MyVisualizer(metric='cosine')
  >>> model.fit(X)
  >>> model.show()
docstr: The fit method is the primary drawing input for the UMAP projection
  since the visualization requires both X and an optional y value. The
  fit method expects an array of numeric vectors, so text documents must
  be vectorized before passing them to this method.
  
  Parameters
  ----------
  X : ndarray or DataFrame of shape n x m
      A matrix of n instances with m features representing the corpus of
      vectorized documents to visualize with UMAP.
  
  y : ndarray or Series of length n
      An optional array or series of target or class values for
      instances. If this is specified, then the points will be colored
      according to their class. Often cluster labels are passed in to
      color the documents in cluster space, so this method is used both
      for classification and clustering methods.
  
  kwargs : dict
      Pass generic arguments to the drawing method
  
  Returns
  -------
  self : instance
      Returns the instance of the transformer/visualizer
docstr_tok: ["The","fit","method","is","the","primary","drawing","input","for","the","UMAP","projection","since","the","visualization","requires","both","X","and","an","optional","y","value",".","The","fit","method","expects","an","array","of","numeric","vectors",",","so","text","documents","must","be","vectorized","before","passing","them","to","this","method",".","Parameters","--","--","--","--","--","X",":","ndarray","or","DataFrame","of","shape","n","x","m","A","matrix","of","n","instances","with","m","features","representing","the","corpus","of","vectorized","documents","to","visualize","with","UMAP",".","y",":","ndarray","or","Series","of","length","n","An","optional","array","or","series","of","target","or","class","values","for","instances",".","If","this","is","specified",",","then","the","points","will","be","colored","according","to","their","class",".","Often","cluster","labels","are","passed","in","to","color","the","documents","in","cluster","space",",","so","this","method","is","used","both","for","classification","and","clustering","methods",".","kwargs",":","dict","Pass","generic","arguments","to","the","drawing","method","Returns","--","--","--","-","self",":","instance","Returns","the","instance","of","the","transformer\/visualizer"]
code: def fit(self, X, y=None, **kwargs):
      """
      The fit method is the primary drawing input for the UMAP projection
      since the visualization requires both X and an optional y value. The
      fit method expects an array of numeric vectors, so text documents must
      be vectorized before passing them to this method.
  
      Parameters
      ----------
      X : ndarray or DataFrame of shape n x m
          A matrix of n instances with m features representing the corpus of
          vectorized documents to visualize with UMAP.
  
      y : ndarray or Series of length n
          An optional array or series of target or class values for
          instances. If this is specified, then the points will be colored
          according to their class. Often cluster labels are passed in to
          color the documents in cluster space, so this method is used both
          for classification and clustering methods.
  
      kwargs : dict
          Pass generic arguments to the drawing method
  
      Returns
      -------
      self : instance
          Returns the instance of the transformer/visualizer
      """
  
      # Store the classes we observed in y
      if y is not None:
          self.classes_ = np.unique(y)
      elif y is None and self.labels is not None:
          self.classes_ = np.array([self.labels[0]])
      else:
          self.classes_ = np.array([self.NULL_CLASS])
  
      # Fit our internal transformer and transform the data.
      vecs = self.transformer_.fit_transform(X)
      self.n_instances_ = vecs.shape[0]
  
      # Draw the vectors
      self.draw(vecs, y, **kwargs)
  
      # Fit always returns self.
      return self
  
file_path: yellowbrick/yellowbrick/text/umap_vis.py
imports: import warnings
  import numpy
  from collections import defaultdict
  from yellowbrick.draw import manual_legend
  from yellowbrick.text.base import TextVisualizer
  from yellowbrick.style.colors import resolve_colors
  from yellowbrick.exceptions import YellowbrickValueError
  from sklearn.pipeline import Pipeline
label_desc: Use image node_id 3 for calling the UMAPVisualizer obj's underlying member method code with example usage: obj.fit(X, y) and returns: self