class_docstr: Wraps a cuML algorithm and (optionally) a cpu-based algorithm
  (typically scikit-learn, but does not need to be as long as it offers
  `fit` and `predict` or `transform` methods).
  Provides mechanisms to run each version with default arguments.
  If no CPU-based version of the algorithm is available, pass None for the
  cpu_class when instantiating
  
  Parameters
  ----------
  cpu_class : class
     Class for CPU version of algorithm. Set to None if not available.
  cuml_class : class
     Class for cuML algorithm
  shared_args : dict
     Arguments passed to both implementations's initializer
  cuml_args : dict
     Arguments *only* passed to cuml's initializer
  cpu_args dict
     Arguments *only* passed to sklearn's initializer
  accepts_labels : boolean
     If True, the fit methods expects both X and y
     inputs. Otherwise, it expects only an X input.
  data_prep_hook : function (data -> data)
     Optional function to run on input data before passing to fit
  accuracy_function : function (y_test, y_pred)
     Function that returns a scalar representing accuracy
  bench_func : custom function to perform fit/predict/transform
               calls.
class_docstr_tok: ["Wraps","a","cuML","algorithm","and","(","optionally",")","a","cpu-based","algorithm","(","typically","scikit-learn",",","but","does","not","need","to","be","as","long","as","it","offers","`","fit","`","and","`","predict","`","or","`","transform","`","methods",")",".","Provides","mechanisms","to","run","each","version","with","default","arguments",".","If","no","CPU-based","version","of","the","algorithm","is","available",",","pass","None","for","the","cpu_class","when","instantiating","Parameters","--","--","--","--","--","cpu_class",":","class","Class","for","CPU","version","of","algorithm",".","Set","to","None","if","not","available",".","cuml_class",":","class","Class","for","cuML","algorithm","shared_args",":","dict","Arguments","passed","to","both","implementations","'s","initializer","cuml_args",":","dict","Arguments","*","only","*","passed","to","cuml","'s","initializer","cpu_args","dict","Arguments","*","only","*","passed","to","sklearn","'s","initializer","accepts_labels",":","boolean","If","True",",","the","fit","methods","expects","both","X","and","y","inputs",".","Otherwise",",","it","expects","only","an","X","input",".","data_prep_hook",":","function","(","data","-",">","data",")","Optional","function","to","run","on","input","data","before","passing","to","fit","accuracy_function",":","function","(","y_test",",","y_pred",")","Function","that","returns","a","scalar","representing","accuracy","bench_func",":","custom","function","to","perform","fit\/predict\/transform","calls","."]
docstr: Runs the cuml-based algorithm's fit method on specified data
docstr_tok: ["Runs","the","cuml-based","algorithm","'s","fit","method","on","specified","data"]
code: def run_cuml(self, data, bench_args={}, **override_setup_args):
      """Runs the cuml-based algorithm's fit method on specified data"""
      all_args = {**self.shared_args, **self.cuml_args}
      all_args = {**all_args, **override_setup_args}
  
      if "cuml_setup_result" not in all_args:
          cuml_obj = self.cuml_class(**all_args)
      else:
          cuml_obj = all_args["cuml_setup_result"]
      if self.cuml_data_prep_hook:
          data = self.cuml_data_prep_hook(data)
      if self.accepts_labels:
          self.bench_func(cuml_obj, data[0], data[1], **bench_args)
      else:
          self.bench_func(cuml_obj, data[0], **bench_args)
  
      return cuml_obj
  
imports: import treelite_runtime
  import treelite
  from cuml.benchmark.bench_helper_funcs import fit, transform, predict, fit_transform, fit_predict, fit_kneighbors, _build_cpu_skl_classifier, _build_fil_skl_classifier, _build_fil_classifier, _build_gtil_classifier, _build_optimized_fil_classifier, _build_treelite_classifier, _treelite_fil_accuracy_score, _training_data_to_numpy, _build_mnmg_umap
  from cuml.preprocessing import StandardScaler, MinMaxScaler, MaxAbsScaler, Normalizer, SimpleImputer, RobustScaler, PolynomialFeatures
  import tempfile
  import cuml
  import sklearn
  import sklearn.cluster
  import sklearn.neighbors
  import sklearn.ensemble
  import sklearn.random_projection
  import sklearn.naive_bayes
  from sklearn import metrics
  from sklearn.impute import SimpleImputer
  import cuml.metrics
  import cuml.decomposition
  import cuml.experimental
  import cuml.naive_bayes
  from cuml.dask import neighbors, cluster, manifold, decomposition, linear_model
  from cuml.internals.import_utils import has_hdbscan, has_umap
  from cuml.internals.safe_imports import cpu_only_import
label_desc: Use image node_id 4 for calling the AlgorithmPair obj's underlying member method code with example usage: obj.run_cuml(data, bench_args) and returns: cuml_obj