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 the next version of UMAP.
    In the meantime cosine distance is likely a better text default that Euclidean and can be set using
    the keyword arg metric='cosine'.

    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.

    ax : matplotlib axes
        The axes to plot the figure on.

    classes : list of strings
        The names of the classes in the target, used to create a legend.

    colors : list or tuple of colors
        Specify the colors for each individual class

    colormap : string or matplotlib cmap
        Sequential colormap for continuous target

    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.

    Returns
    -------
    ax : matplotlib axes
        Returns the axes that the parallel coordinates were drawn on.

def umap(X, y=None, ax=None, classes=None,
           colors=None, colormap=None, alpha=0.7, **kwargs):
    """
    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 the next version of UMAP.
    In the meantime cosine distance is likely a better text default that Euclidean and can be set using
    the keyword arg metric='cosine'.

    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.

    ax : matplotlib axes
        The axes to plot the figure on.

    classes : list of strings
        The names of the classes in the target, used to create a legend.

    colors : list or tuple of colors
        Specify the colors for each individual class

    colormap : string or matplotlib cmap
        Sequential colormap for continuous target

    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.

    Returns
    -------
    ax : matplotlib axes
        Returns the axes that the parallel coordinates were drawn on.
    """
    # Instantiate the visualizer
    visualizer = UMAPVisualizer(
        ax, classes, colors, colormap, alpha, **kwargs
    )

    # Fit and transform the visualizer (calls draw)
    visualizer.fit_transform(X, y, **kwargs)
    #visualizer.transform(X)

    # Return the axes object on the visualizer
    return visualizer.ax