code: def test_cuml_rf_regressor(input_type):
      n_samples = 100
      X, y = make_regression(
          n_samples=n_samples,
          n_features=8,
          n_informative=8,
          n_targets=1,
          random_state=2021,
      )
      X, y = X.astype(np.float32), y.astype(np.float32)
      if input_type == "cupy":
          X, y = cp.array(X), cp.array(y)
      elif input_type == "cudf":
          X, y = cudf.DataFrame(X), cudf.Series(y)
      cuml_model = curfr(
          max_features=1.0,
          max_samples=0.1,
          n_bins=128,
          min_samples_leaf=2,
          random_state=123,
          n_streams=1,
          n_estimators=10,
          max_leaves=-1,
          max_depth=16,
          accuracy_metric="mse",
      )
      cuml_model.fit(X, y)
      pred = cuml_model.predict(X)
  
      explainer = TreeExplainer(model=cuml_model)
      out = explainer.shap_values(X)
      if input_type == "cupy":
          pred = pred.get()
          out = out.get()
          expected_value = explainer.expected_value.get()
      elif input_type == "cudf":
          pred = pred.to_numpy()
          out = out.get()
          expected_value = explainer.expected_value.get()
      else:
          expected_value = explainer.expected_value
      # SHAP values should add up to predicted score
      shap_sum = np.sum(out, axis=1) + expected_value
      np.testing.assert_almost_equal(shap_sum, pred, decimal=4)
  
imports: from cuml.testing.utils import as_type
  import cuml
  from cuml.ensemble import RandomForestClassifier
  from cuml.ensemble import RandomForestRegressor
  from cuml.common.exceptions import NotFittedError
  from cuml.internals.import_utils import has_sklearn
  from cuml.internals.import_utils import has_lightgbm, has_shap
  from cuml.explainer.tree_shap import TreeExplainer
  from hypothesis import given, settings, assume, HealthCheck, strategies
  from cuml.internals.safe_imports import gpu_only_import
  import json
  import pytest
  import treelite
  from cuml.internals.safe_imports import cpu_only_import
label_desc: Use image node_id 8 for calling a global function with example usage: test_cuml_rf_regressor(input_type) without return types