code: def test_rf_classification_multi_class(
      partitions_per_worker, cluster
  ):
      # Use CUDA_VISIBLE_DEVICES to control the number of workers
      c = Client(cluster)
      n_workers = len(c.scheduler_info()["workers"])
  
      try:
          X, y = make_classification(
              n_samples=n_workers * 5000,
              n_features=20,
              n_clusters_per_class=1,
              n_informative=10,
              random_state=123,
              n_classes=15,
          )
  
          X = X.astype(np.float32)
          y = y.astype(np.int32)
  
          X_train, X_test, y_train, y_test = train_test_split(
              X, y, test_size=n_workers * 300, random_state=123
          )
  
          cu_rf_params = {
              "n_estimators": n_workers * 8,
              "max_depth": 16,
              "n_bins": 256,
              "random_state": 10,
          }
  
          X_train_df, y_train_df = _prep_training_data(
              c, X_train, y_train, partitions_per_worker
          )
  
          cuml_mod = cuRFC_mg(
              **cu_rf_params, ignore_empty_partitions=True
          )
          cuml_mod.fit(X_train_df, y_train_df)
          X_test_dask_array = from_array(X_test)
          cuml_preds_gpu = cuml_mod.predict(
              X_test_dask_array, predict_model="GPU"
          ).compute()
          acc_score_gpu = accuracy_score(cuml_preds_gpu, y_test)
  
          # the sklearn model when ran with the same parameters gives an
          # accuracy of 0.69. There is a difference of 0.0632 (6.32%) between
          # the two when the code runs on a single GPU (seen in the CI)
          # Refer to issue : https://github.com/rapidsai/cuml/issues/2806 for
          # more information on the threshold value.
  
          assert acc_score_gpu >= 0.52
  
      finally:
          c.close()
  
imports: from dask.distributed import Client
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.metrics import accuracy_score, r2_score, mean_squared_error
  from sklearn.model_selection import train_test_split
  from sklearn.datasets import make_regression, make_classification
  from dask.array import from_array
  from cuml.ensemble import RandomForestRegressor
  from cuml.ensemble import RandomForestClassifier
  from cuml.dask.common import utils
  from cuml.dask.ensemble import RandomForestRegressor
  from cuml.dask.ensemble import RandomForestClassifier
  from cuml.internals.safe_imports import cpu_only_import
  import json
  import pytest
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 2 for calling a global function with example usage: test_rf_classification_multi_class(partitions_per_worker, cluster) without return types