code: def plot_tree_interactive(X, y):
      from sklearn.tree import DecisionTreeClassifier
  
      def interactive_tree(depth=1):
          clf = DecisionTreeClassifier(max_depth=depth, random_state=0)
          visualize_tree(clf, X, y)
  
      from IPython.html.widgets import interact
  
      return interact(interactive_tree, depth=[1, 5])
  
file_path: data-science-ipython-notebooks/scikit-learn/fig_code/figures.py
imports: import numpy
  import matplotlib.pyplot
  import warnings
label_desc: Use image node_id 4 for calling a global function with example usage: plot_tree_interactive(X, y) and returns: interact