class_docstr: UMAP Mixin for automagic UMAPing
class_docstr_tok: ["UMAP","Mixin","for","automagic","UMAPing"]
code: def umap_fit(
      self,
      X: pd.DataFrame,
      y: Union[pd.DataFrame, None] = None,
      verbose=False,
  ):
      if self._umap is None:
          raise ValueError("UMAP is not initialized")
      t = time()
      y = self._check_target_is_one_dimensional(y)
      logger.info("-" * 90)
      logger.info(f"Starting UMAP-ing data of shape {X.shape}")
  
      if self.engine == CUML and is_legacy_cuml():  # type: ignore
          from cuml.neighbors import NearestNeighbors
  
          knn = NearestNeighbors(n_neighbors=self._n_neighbors)  # type: ignore
          cc = self._umap.fit(X, y, knn_graph=knn)
          knn.fit(cc.embedding_)
          self._umap.graph_ = knn.kneighbors_graph(cc.embedding_)
      else:
          self._umap.fit(X, y)
  
      self._weighted_adjacency = self._umap.graph_
      # if changing, also update fresh_res
      self._weighted_edges_df = umap_graph_to_weighted_edges(
          self._umap.graph_, self.engine, is_legacy_cuml()  # type: ignore
      )
  
      mins = (time() - t) / 60
      logger.info(f"-UMAP-ing took {mins:.2f} minutes total")
      logger.info(f" - or {X.shape[0]/mins:.2f} rows per minute")
      return self
  
imports: import copy
  from time import time
  from typing import TYPE_CHECKING, Any, Dict, Optional, Tuple, Union
  from inspect import getmodule
  import pandas
  from .None import constants
  from .constants import CUML, UMAP_LEARN
  from .feature_utils import FeatureMixin, Literal, XSymbolic, YSymbolic, prune_weighted_edges_df_and_relabel_nodes, resolve_feature_engine
  from .PlotterBase import Plottable, WeakValueDictionary
  from .util import check_set_memoize
  import logging
label_desc: Use image node_id 5 for calling the UMAPMixin obj's underlying member method code with example usage: obj.umap_fit(X, y, verbose) and returns: self