code: def explain_prediction_sklearn_default(
      shadow_tree: ShadowDecTree,
      x: (pd.core.series.Series, np.ndarray),
      colors: dict = None,
      fontsize: int = 10,
      fontname: str = "Arial",
      grid: bool = False,
      figsize: tuple = None,
      ax=None,
  ):
      """
      Explain prediction calculating features importance using sklearn default algorithm : mean decrease in impurity
      (or gini importance) mechanism.
      This mechanism can be biased, especially for situations where features vary in their scale of measurement or
      their number of categories.
      For more details, you can read this article : https://explained.ai/rf-importance/index.html
  
      :param shadow_tree: tree used to make prediction
      :param x: Instance example to make prediction
      :param colors: dict, optional
          The set of colors used for plotting
      :param fontsize: int, optional
          Plot labels fontsize
      :param fontname: str, optional
          Plot labels font name
      :param grid: bool
          True if we want to display the grid lines on the visualization
      :param figsize: optional (width, height) in inches for the entire plot
      :param ax: optional matplotlib "axes" to draw into
      """
      decision_node_path = shadow_tree.predict_path(x)
      decision_node_path = [node.id for node in decision_node_path]
  
      feature_path_importance = shadow_tree.get_feature_path_importance(
          decision_node_path
      )
  
      colors = adjust_colors(colors)
      if ax is None:
          if figsize:
              fig, ax = plt.subplots(figsize=figsize)
          else:
              fig, ax = plt.subplots()
  
      df = pd.DataFrame()
      df["features"] = shadow_tree.feature_names
      df["imp"] = feature_path_importance
      df = df.sort_values("imp", ascending=True)
  
      barcontainers = ax.barh(
          y=df["features"],
          width=df["imp"],
          color=colors["hist_bar"],
          lw=0.3,
          align="center",
          height=1,
      )
      for rect in barcontainers.patches:
          rect.set_linewidth(0.5)
          rect.set_edgecolor(colors["rect_edge"])
  
      _format_axes(
          ax,
          "Feature Importance",
          "Features",
          colors,
          fontsize,
          fontname,
          grid=grid,
      )
  
file_path: dtreeviz/dtreeviz/interpretation.py
imports: from collections import defaultdict
  import numpy
  import pandas
  from matplotlib import pyplot
  from dtreeviz.colors import adjust_colors
  from dtreeviz.models.shadow_decision_tree import ShadowDecTree
  from dtreeviz.utils import _format_axes
label_desc: Use image node_id 2 for calling a global function with example usage: explain_prediction_sklearn_default(shadow_tree, x, colors, fontsize, fontname, grid, figsize, ax) without return types