class_docstr: UMAP Mixin for automagic UMAPing
class_docstr_tok: ["UMAP","Mixin","for","automagic","UMAPing"]
docstr: Returns res mutated with new _xy
docstr_tok: ["Returns","res","mutated","with","new","_xy"]
code: def _process_umap(
      self,
      res,
      X_: pd.DataFrame,
      y_: pd.DataFrame,
      kind,
      memoize: bool,
      featurize_kwargs,
      verbose=False,
      **umap_kwargs,
  ):
      """
      Returns res mutated with new _xy
      """
      # from .features import ModelDict
      umap_kwargs_pure = umap_kwargs.copy()
  
      logger.debug("process_umap before kwargs: %s", umap_kwargs)
      umap_kwargs.update({"kind": kind, "X": X_, "y": y_})
      umap_kwargs_reuse = {
          **umap_kwargs,
          "featurize_kwargs": featurize_kwargs or {},
      }
      logger.debug("process_umap after kwargs: %s", umap_kwargs_reuse)
  
      old_res = reuse_umap(
          res,
          memoize,
          {
              **umap_kwargs_reuse,
              "featurize_kwargs": featurize_kwargs or {},
          },
      )
      if old_res:
          print(" --- [[ RE-USING UMAP ]]") if verbose else None
          logger.info(" --- [[ RE-USING UMAP ]]")
          print(
              "umap previous n_components", umap_kwargs["n_components"]
          ) if verbose else None
          fresh_res = copy.copy(res)
          for attr in [
              "_xy",
              "_weighted_edges_df",
              "_weighted_adjacency",
          ]:
              if hasattr(old_res, attr):
                  setattr(fresh_res, attr, getattr(old_res, attr))
          # have to set _raw_data attribute on umap?
          fresh_res._umap = old_res._umap  # this saves the day!
          # fresh_res._umap_initialized = True
          fresh_res._umap_params = umap_kwargs_pure
          return fresh_res
  
      print("-" * 60) if verbose else None
      print("** Fitting UMAP") if verbose else None
      res = res.umap_lazy_init(res, verbose=verbose, **umap_kwargs_pure)
  
      emb = res._umap_fit_transform(X_, y_, verbose=verbose)
      res._xy = emb
      return res
  
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 9 for calling the UMAPMixin obj's underlying member method code with example usage: obj._process_umap(res, X_, y_, kind, memoize, featurize_kwargs, verbose) and returns: res, fresh_res