code: def test_fil_skl_regression(
      n_rows,
      n_columns,
      n_classes,
      model_class,
      n_estimators,
      max_depth,
      storage_type,
  ):
      # 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)
  
      algo = "NAIVE" if storage_type else "BATCH_TREE_REORG"
  
      fm = ForestInference.load_from_sklearn(
          skl_model,
          algo=algo,
          output_class=False,
          storage_type=storage_type,
      )
      fil_preds = np.asarray(fm.predict(X_validation))
      fil_preds = np.reshape(fil_preds, np.shape(skl_preds))
  
      fil_mse = mean_squared_error(y_validation, fil_preds)
  
      # NOTE(wphicks): Tolerance has been temporarily increased from 1.e-6/1e-4
      # to 1e-4/1e-2. This is too high of a tolerance for this test, but we will
      # use it to unblock CI while investigating the underlying issue.
      # https://github.com/rapidsai/cuml/issues/5138
      assert fil_mse <= skl_mse * (1.0 + 1e-4) + 1e-2
      # NOTE(wphicks): Tolerance has been temporarily increased from 1.2e-3 to
      # 1.2e-2. This test began failing CI due to the previous tolerance more
      # regularly, and while the root cause is under investigation
      # (https://github.com/rapidsai/cuml/issues/5138), the tolerance has simply
      # been reduced. Combined with the above assertion, this is still a very
      # reasonable threshold.
      assert np.allclose(fil_preds, skl_preds, 1.2e-2)
  
imports: from sklearn.model_selection import train_test_split
  from sklearn.metrics import accuracy_score, mean_squared_error
  from sklearn.ensemble import GradientBoostingClassifier, GradientBoostingRegressor, RandomForestClassifier, RandomForestRegressor, ExtraTreesClassifier, ExtraTreesRegressor
  from sklearn.datasets import make_classification, make_regression
  from cuml.internals.import_utils import has_xgboost
  from cuml.testing.utils import array_equal, unit_param, quality_param, stress_param
  from cuml import ForestInference
  from math import ceil
  import os
  import pytest
  from cuml.internals.safe_imports import cpu_only_import
label_desc: Use image node_id 6 for calling a global function with example usage: test_fil_skl_regression(n_rows, n_columns, n_classes, model_class, n_estimators, max_depth, storage_type) without return types