code: def make_classification_with_categorical(
      *,
      n_samples,
      n_features,
      n_categorical,
      n_informative,
      n_redundant,
      n_repeated,
      n_classes,
      random_state,
      numeric_dtype=np.float32,
  ):
      X, y = make_classification(
          n_samples=n_samples,
          n_features=n_features,
          n_informative=n_informative,
          n_redundant=n_redundant,
          n_repeated=n_repeated,
          n_classes=n_classes,
          random_state=random_state,
          n_clusters_per_class=min(2, n_features),
      )
      X, y = X.astype(numeric_dtype), y.astype(numeric_dtype)
  
      # Turn some columns into categorical, by taking quartiles
      n = np.atleast_1d(y).shape[0]
      X = pd.DataFrame({f"f{i}": X[:, i] for i in range(n_features)})
      for i in range(n_categorical):
          column = f"f{i}"
          n_bins = min(4, n)
          X[column] = pd.qcut(X[column], n_bins, labels=range(n_bins))
      # make sure each target exists
      y[0:n_classes] = range(n_classes)
  
      assert len(np.unique(y)) == n_classes
      return X, y
  
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 2 for calling a global function with example usage: make_classification_with_categorical() and returns: X,  y