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: Decision trees partition feature space into rectangular regions
  through the series of splits (at internal decision nodes) along the
  path from the root to a leaf while making a prediction for an input
  instance. The complete tessellation of feature space is the collection
  of regions inscribed by all paths from the root to a leaf.
  
  This function isolates one or two features of interest according to
  the features parameter and generates a plot.  For one feature, the
  resulting plot has that feature on the X axis and the associated class
  targets at different elevations (with some noise) on the Y axis to
  separate them.  (Use gtype='barstacked' to get a histogram instead.)
  For two features, the plot has the two features of
  interest on the X and Y axes and plots the 2D coordinate for each
  training data instance. Each marker and region has a unique color
  according to the classification label.
  
  Decision nodes associated with features not in the features parameter
  do not contribute to the tessellation of the feature space. Paths from
  the root to leaves in the decision tree do not contribute a region unless
  one or more of the features of interest is tested.  Given a model
  trained with exactly two features, calling this function with those
  two features results in disjoint regions. Any coordinate in 2D feature
  space would always lead to a unique leaf.
  
  When the model is trained on more than two features, however, the same
  coordinate in the 2D feature space of interest could appear in
  multiple paths from the root to a leaf. Consequently, it is possible
  for regions to overlap because the tree is testing other variables
  along those paths (so that each coordinate in d-space for d model
  features still reaches a unique leaf).  Overlapping regions simply
  means another feature would disambiguate those regions during model
  inference.
  
  :param gtype: {'strip','barstacked'}
  :param show: Plot elements to show: {'title', 'legend', 'splits'}
  :param features: A list of strings containing one or two features of interest.
                   If none is specified, the first feature(s) in X_training dataframe are used.
  :param figsize: Width and height in inches for the figure; use something like (5,1)
                  for len(features)==1 and (5,3) for len(features)==1.
code: def ctree_feature_space(
      self,
      fontsize=10,
      ticks_fontsize=8,
      fontname="Arial",
      nbins=25,
      gtype="strip",
      show={"title", "legend", "splits"},
      colors=None,
      features=None,
      figsize=None,
      ax=None,
  ):
      """
      Decision trees partition feature space into rectangular regions
      through the series of splits (at internal decision nodes) along the
      path from the root to a leaf while making a prediction for an input
      instance. The complete tessellation of feature space is the collection
      of regions inscribed by all paths from the root to a leaf.
  
      This function isolates one or two features of interest according to
      the features parameter and generates a plot.  For one feature, the
      resulting plot has that feature on the X axis and the associated class
      targets at different elevations (with some noise) on the Y axis to
      separate them.  (Use gtype='barstacked' to get a histogram instead.)
      For two features, the plot has the two features of
      interest on the X and Y axes and plots the 2D coordinate for each
      training data instance. Each marker and region has a unique color
      according to the classification label.
  
      Decision nodes associated with features not in the features parameter
      do not contribute to the tessellation of the feature space. Paths from
      the root to leaves in the decision tree do not contribute a region unless
      one or more of the features of interest is tested.  Given a model
      trained with exactly two features, calling this function with those
      two features results in disjoint regions. Any coordinate in 2D feature
      space would always lead to a unique leaf.
  
      When the model is trained on more than two features, however, the same
      coordinate in the 2D feature space of interest could appear in
      multiple paths from the root to a leaf. Consequently, it is possible
      for regions to overlap because the tree is testing other variables
      along those paths (so that each coordinate in d-space for d model
      features still reaches a unique leaf).  Overlapping regions simply
      means another feature would disambiguate those regions during model
      inference.
  
      :param gtype: {'strip','barstacked'}
      :param show: Plot elements to show: {'title', 'legend', 'splits'}
      :param features: A list of strings containing one or two features of interest.
                       If none is specified, the first feature(s) in X_training dataframe are used.
      :param figsize: Width and height in inches for the figure; use something like (5,1)
                      for len(features)==1 and (5,3) for len(features)==1.
      """
  
      # TODO: check if we can find some common functionality between univar and bivar visualisations and refactor
      #  to a single method.
      if features is None:
          n_features = len(self.shadow_tree.feature_names)
          features = self.shadow_tree.feature_names[
              0 : min(n_features, 2)
          ]  # pick first one/two features if none given
      if len(features) == 1:  # univar example
          _ctreeviz_univar(
              self.shadow_tree,
              fontsize,
              ticks_fontsize,
              fontname,
              nbins,
              gtype,
              show,
              colors,
              features[0],
              figsize,
              ax,
          )
      elif len(features) == 2:  # bivar example
          _ctreeviz_bivar(
              self.shadow_tree,
              fontsize,
              ticks_fontsize,
              fontname,
              show,
              colors,
              features,
              figsize,
              ax,
          )
      else:
          raise ValueError(
              f"ctree_feature_space supports a dataset with only one or two features."
              f" You provided a dataset with {len(self.shadow_tree.feature_names)} features {self.shadow_tree.feature_names}."
          )
  
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 10 for calling the DTreeVizAPI obj's underlying member method code with example usage: obj.ctree_feature_space(fontsize, ticks_fontsize, fontname, nbins, gtype, show, colors, features, figsize, ax) without return types