code: def rf_classification(
      datatype, array_type, max_features, max_samples, fixture
  ):
      X, y = fixture
      X = X.astype(datatype[0])
      y = y.astype(np.int32)
      X_train, X_test, y_train, y_test = train_test_split(
          X, y, train_size=0.8, random_state=0
      )
      X_test = X_test.astype(datatype[1])
  
      n_streams = 1
      handle, stream = get_handle(True, n_streams=n_streams)
      # Initialize, fit and predict using cuML's
      # random forest classification model
      cuml_model = curfc(
          max_features=max_features,
          max_samples=max_samples,
          n_bins=16,
          split_criterion=0,
          min_samples_leaf=2,
          random_state=999,
          n_estimators=40,
          handle=handle,
          max_leaves=-1,
          max_depth=16,
          n_streams=n_streams,
      )
      if array_type == "dataframe":
          X_train_df = cudf.DataFrame(X_train)
          y_train_df = cudf.Series(y_train)
          X_test_df = cudf.DataFrame(X_test)
          cuml_model.fit(X_train_df, y_train_df)
          cu_proba_gpu = cuml_model.predict_proba(X_test_df).to_numpy()
          cu_preds_cpu = cuml_model.predict(
              X_test_df, predict_model="CPU"
          ).to_numpy()
          cu_preds_gpu = cuml_model.predict(
              X_test_df, predict_model="GPU"
          ).to_numpy()
      else:
          cuml_model.fit(X_train, y_train)
          cu_proba_gpu = cuml_model.predict_proba(X_test)
          cu_preds_cpu = cuml_model.predict(X_test, predict_model="CPU")
          cu_preds_gpu = cuml_model.predict(X_test, predict_model="GPU")
      np.testing.assert_array_equal(
          cu_preds_gpu, np.argmax(cu_proba_gpu, axis=1)
      )
  
      cu_acc_cpu = accuracy_score(y_test, cu_preds_cpu)
      cu_acc_gpu = accuracy_score(y_test, cu_preds_gpu)
      assert cu_acc_cpu == pytest.approx(cu_acc_gpu, abs=0.01, rel=0.1)
  
      # sklearn random forest classification model
      # initialization, fit and predict
      if y.size < 500000:
          sk_model = skrfc(
              n_estimators=40,
              max_depth=16,
              min_samples_split=2,
              max_features=max_features,
              random_state=10,
          )
          sk_model.fit(X_train, y_train)
          sk_preds = sk_model.predict(X_test)
          sk_acc = accuracy_score(y_test, sk_preds)
          sk_proba = sk_model.predict_proba(X_test)
          assert cu_acc_cpu >= sk_acc - 0.07
          assert cu_acc_gpu >= sk_acc - 0.07
          # 0.06 is the highest relative error observed on CI, within
          # 0.0061 absolute error boundaries seen previously
          check_predict_proba(cu_proba_gpu, sk_proba, y_test, 0.1)
  
imports: import treelite
  from sklearn.model_selection import train_test_split
  from sklearn.datasets import fetch_california_housing, make_classification, make_regression, load_iris, load_breast_cancer
  from sklearn.metrics import accuracy_score, mean_squared_error, mean_tweedie_deviance
  from sklearn.ensemble import RandomForestRegressor
  from sklearn.ensemble import RandomForestClassifier
  import cuml.internals.logger
  from cuml.testing.utils import get_handle, unit_param, quality_param, stress_param
  from cuml.metrics import r2_score
  from cuml.ensemble import RandomForestRegressor
  from cuml.ensemble import RandomForestClassifier
  import cuml
  from cuml.internals.safe_imports import gpu_only_import_from
  import os
  import json
  import random
  from cuml.internals.safe_imports import cpu_only_import
  import pytest
  import warnings
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 14 for calling a global function with example usage: rf_classification(datatype, array_type, max_features, max_samples, fixture) without return types