code: def test_uplift_tree_visualization():
      # Data generation
      df, x_names = make_uplift_classification()
  
      # Rename features for easy interpretation of visualization
      x_names_new = ["feature_%s" % (i) for i in range(len(x_names))]
      rename_dict = {
          x_names[i]: x_names_new[i] for i in range(len(x_names))
      }
      df = df.rename(columns=rename_dict)
      x_names = x_names_new
  
      df.head()
  
      df = df[df["treatment_group_key"].isin(["control", "treatment1"])]
  
      # Split data to training and testing samples for model validation (next section)
      df_train, df_test = train_test_split(
          df, test_size=0.2, random_state=111
      )
  
      # Train uplift tree
      uplift_model = UpliftTreeClassifier(
          max_depth=4,
          min_samples_leaf=200,
          min_samples_treatment=50,
          n_reg=100,
          evaluationFunction="KL",
          control_name="control",
      )
  
      uplift_model.fit(
          df_train[x_names].values,
          treatment=df_train["treatment_group_key"].values,
          y=df_train["conversion"].values,
      )
  
      # Plot uplift tree
      graph = uplift_tree_plot(uplift_model.fitted_uplift_tree, x_names)
      graph.create_png()
  
file_path: causalml/tests/test_uplift_trees.py
imports: import cProfile
  import numpy
  import pandas
  import pytest
  import pstats
  from joblib import parallel_backend
  from sklearn.model_selection import train_test_split
  from causalml.inference.tree import UpliftTreeClassifier, UpliftRandomForestClassifier
  from causalml.metrics import get_cumgain
  from causalml.dataset import make_uplift_classification
  from causalml.inference.tree import uplift_tree_string, uplift_tree_plot
  from .const import RANDOM_SEED, N_SAMPLE, CONTROL_NAME, TREATMENT_NAMES, CONVERSION
label_desc: Use image node_id 7 for calling a global function with example usage: test_uplift_tree_visualization() without return types