class_docstr: This object provides the primary interface to the functionality of this library. You can think of it as
  an adaptor that adapts the various decision-tree based libraries for use with dtreeviz. In implementation,
  however, this object encapsulates the key functionality and API but delegates tree model adaptation
  from sklearn etc... to dtreeviz.models.ShadowDecTree subclasses.
class_docstr_tok: ["This","object","provides","the","primary","interface","to","the","functionality","of","this","library",".","You","can","think","of","it","as","an","adaptor","that","adapts","the","various","decision-tree","based","libraries","for","use","with","dtreeviz",".","In","implementation",",","however",",","this","object","encapsulates","the","key","functionality","and","API","but","delegates","tree","model","adaptation","from","sklearn","etc","...","to","dtreeviz.models.ShadowDecTree","subclasses","."]
docstr: Prediction feature importance for a data instance.
  
  There will be created a visualisation for feature importance, just like the popular one from sklearn library,
  but in this scencario, the feature importances will be calculated based only on the nodes from prediction path.
  
  Usage example :
  viz_model = dtreeviz.model(tree_model, X_train=dataset[features], y_train=dataset[target],
                             feature_names=features, target_name=target, class_names=[0, 1])
  viz_model.instance_feature_importance(x)
  
  :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
code: def instance_feature_importance(
      self,
      x,
      colors: dict = None,
      fontsize: int = 10,
      fontname: str = "Arial",
      grid: bool = False,
      figsize: tuple = None,
      ax=None,
  ):
      """Prediction feature importance for a data instance.
  
      There will be created a visualisation for feature importance, just like the popular one from sklearn library,
      but in this scencario, the feature importances will be calculated based only on the nodes from prediction path.
  
      Usage example :
      viz_model = dtreeviz.model(tree_model, X_train=dataset[features], y_train=dataset[target],
                                 feature_names=features, target_name=target, class_names=[0, 1])
      viz_model.instance_feature_importance(x)
  
      :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
      """
      explain_prediction_sklearn_default(
          self.shadow_tree,
          x,
          colors,
          fontsize,
          fontname,
          grid,
          figsize,
          ax,
      )
  
imports: import os
  import tempfile
  from typing import Mapping, List, Callable
  import matplotlib
  import matplotlib.patches
  import matplotlib.pyplot
  import numpy
  import pandas
  from colour import Color, rgb2hex
  from sklearn import tree
  from dtreeviz.colors import adjust_colors
  from dtreeviz.interpretation import explain_prediction_plain_english, explain_prediction_sklearn_default
  from dtreeviz.models.shadow_decision_tree import ShadowDecTree
  from dtreeviz.models.shadow_decision_tree import ShadowDecTreeNode
  from dtreeviz.utils import myround, DTreeVizRender, add_classifier_legend, _format_axes, _draw_wedge, _set_wedge_ticks, tessellate, is_numeric
label_desc: Use image node_id 7 for calling the DTreeVizAPI obj's underlying member method code with example usage: obj.instance_feature_importance(x, colors, fontsize, fontname, grid, figsize, ax) without return types