code: def test_large_data_surrogate_error_tree(self):
      # validate tree trains quickly for large data
      (
          X_train,
          y_train,
          X_test,
          y_test,
          _,
      ) = create_binary_classification_dataset(100)
      feature_names = list(X_train.columns)
      model = create_sklearn_random_forest_regressor(X_train, y_train)
      X_test, y_test = replicate_dataset(X_test, y_test)
      assert X_test.shape[0] > 1000000
      t0 = time.time()
      categorical_features = []
      model_analyzer = ModelAnalyzer(
          model, X_test, y_test, feature_names, categorical_features
      )
      max_depth = 3
      num_leaves = 31
      min_child_samples = 20
      categories_reindexed = []
      cat_ind_reindexed = []
      diff = model_analyzer.get_diff()
      surrogate = create_surrogate_model(
          model_analyzer,
          X_test,
          diff,
          max_depth,
          num_leaves,
          min_child_samples,
          cat_ind_reindexed,
      )
      t1 = time.time()
      execution_time = t1 - t0
      print(
          "creating surrogate model took {} seconds".format(
              execution_time
          )
      )
      # assert we don't take too long to train the tree on 1 million rows
      # note we train on >1 million rows in ~1 second
      assert execution_time < 20
      model_json = surrogate._Booster.dump_model()
      tree_structure = model_json["tree_info"][0]["tree_structure"]
      max_split_index = get_max_split_index(tree_structure) + 1
      assert max_split_index == 3
      cache_subtree_features(tree_structure, feature_names)
      pred_y = model_analyzer.model.predict(X_test)
      traversed_X_test = X_test.copy()
      traversed_X_test[DIFF] = diff
      traversed_X_test[TRUE_Y] = y_test
      traversed_X_test[PRED_Y] = pred_y
      t2 = time.time()
      tree = traverse(
          traversed_X_test,
          tree_structure,
          max_split_index,
          (categories_reindexed, cat_ind_reindexed),
          [],
          feature_names,
          metric=model_analyzer.metric,
          classes=model_analyzer.classes,
      )
      t3 = time.time()
      execution_time = t3 - t2
      print("traversing tree took {} seconds".format(execution_time))
      assert tree is not None
  
imports: import re
  import time
  from enum import Enum
  import numpy
  import pandas
  import pytest
  from common_utils import replicate_dataset
  from erroranalysis._internal.cohort_filter import filter_from_cohort
  from erroranalysis._internal.constants import ARG, COLUMN, COMPOSITE_FILTERS, DIFF, LEAF_INDEX, METHOD, OPERATION, PRED_Y, ROW_INDEX, SPLIT_FEATURE, SPLIT_INDEX, TRUE_Y, CohortFilterMethods, CohortFilterOps, Metrics, ModelTask, regression_metrics
  from erroranalysis._internal.error_analyzer import ModelAnalyzer, PredictionsAnalyzer
  from erroranalysis._internal.surrogate_error_tree import TreeSide, cache_subtree_features, compute_error_tree, create_surrogate_model, get_categorical_info, get_max_split_index, traverse
  from rai_test_utils.datasets.tabular import create_adult_census_data, create_binary_classification_dataset, create_cancer_data, create_diabetes_data, create_iris_data, create_simple_titanic_data
  from rai_test_utils.models.model_utils import create_models_classification
  from rai_test_utils.models.sklearn import create_kneighbors_classifier, create_sklearn_random_forest_regressor, create_titanic_pipeline
  from raiutils.exceptions import UserConfigValidationException
label_desc: Use image node_id 4 for calling the TestSurrogateErrorTree obj's underlying member method code with example usage: obj.test_large_data_surrogate_error_tree() without return types