code: def test_fil_skl_regression(
      train_device,
      infer_device,
      n_rows,
      n_columns,
      n_classes,
      model_class,
      n_estimators,
      max_depth,
      storage_type,
  ):
      with using_device_type(train_device):
          # skip depth 20 for dense tests
          if max_depth == 20 and not storage_type:
              return
  
          # settings
          random_state = np.random.RandomState(43210)
  
          X, y = simulate_data(
              n_rows,
              n_columns,
              n_classes,
              random_state=random_state,
              classification=False,
          )
          # identify shape and indices
          train_size = 0.80
  
          (
              X_train,
              X_validation,
              y_train,
              y_validation,
          ) = train_test_split(
              X, y, train_size=train_size, random_state=0
          )
  
          init_kwargs = {
              "n_estimators": n_estimators,
              "max_depth": max_depth,
          }
          if model_class in [
              RandomForestRegressor,
              ExtraTreesRegressor,
          ]:
              init_kwargs["max_features"] = 0.3
              init_kwargs["n_jobs"] = -1
          else:
              # model_class == GradientBoostingRegressor
              init_kwargs["init"] = "zero"
  
          skl_model = model_class(**init_kwargs)
          skl_model.fit(X_train, y_train)
  
          skl_preds = skl_model.predict(X_validation)
  
          skl_mse = mean_squared_error(y_validation, skl_preds)
  
          fm = ForestInference.load_from_sklearn(
              skl_model, output_class=False
          )
      with using_device_type(infer_device):
          fil_preds = np.asarray(fm.predict(X_validation))
          fil_preds = np.reshape(fil_preds, np.shape(skl_preds))
          fm.optimize(batch_size=len(X_validation))
          fil_preds_opt = np.asarray(fm.predict(X_validation))
          fil_preds_opt = np.reshape(fil_preds_opt, np.shape(skl_preds))
  
          fil_mse = mean_squared_error(y_validation, fil_preds)
  
          assert fil_mse <= skl_mse * (1.0 + 1e-6) + 1e-4
          np.testing.assert_allclose(fil_preds, skl_preds, atol=1.2e-3)
          np.testing.assert_allclose(
              fil_preds_opt, fil_preds, atol=1.2e-3
          )
  
imports: import numpy
  import pytest
  import os
  import pandas
  from math import ceil
  from cuml.experimental import ForestInference
  from cuml.testing.utils import array_equal, unit_param, quality_param, stress_param
  from cuml.internals.import_utils import has_lightgbm, has_xgboost
  from cuml.common.device_selection import using_device_type
  from sklearn.datasets import make_classification, make_regression
  from sklearn.ensemble import GradientBoostingClassifier, GradientBoostingRegressor, RandomForestClassifier, RandomForestRegressor, ExtraTreesClassifier, ExtraTreesRegressor
  from sklearn.metrics import accuracy_score, mean_squared_error
  from sklearn.model_selection import train_test_split
  import treelite
label_desc: Use image node_id 6 for calling a global function with example usage: test_fil_skl_regression(train_device, infer_device, n_rows, n_columns, n_classes, model_class, n_estimators, max_depth, storage_type) without return types