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: Visualize leaf target distributions for regression decision trees.
  
  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.rtree_leaf_distributions()
  
  :param show_leaf_labels: bool
      True if the plot should contains the leaf labels on x ax, False otherwise.
  :param colors: dict
      A custom set of colors for visualisations
  :param markersize: int
      Marker size in points.
  :param label_fontsize: int
      Size of the label font
  :param fontname: str
      Font which is used for labels and text
  :param precision: int
      When displaying floating-point numbers, how many digits to display after the decimal point. Default is 1.
  :param grid: bool
      True if we want to display the grid lines on the visualization
  :param prediction_line_width: int
      The width of prediction line.
  :param figsize: optional (width, height) in inches for the entire plot
      :param ax: optional matplotlib "axes" to draw into
code: def rtree_leaf_distributions(
      self,
      show_leaf_labels: bool = True,
      colors: dict = None,
      markersize: int = 50,
      label_fontsize: int = 10,
      fontname: str = "Arial",
      precision: int = 1,
      grid: bool = False,
      prediction_line_width: int = 2,
      figsize: tuple = None,
      ax=None,
  ):
      """Visualize leaf target distributions for regression decision trees.
  
      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.rtree_leaf_distributions()
  
      :param show_leaf_labels: bool
          True if the plot should contains the leaf labels on x ax, False otherwise.
      :param colors: dict
          A custom set of colors for visualisations
      :param markersize: int
          Marker size in points.
      :param label_fontsize: int
          Size of the label font
      :param fontname: str
          Font which is used for labels and text
      :param precision: int
          When displaying floating-point numbers, how many digits to display after the decimal point. Default is 1.
      :param grid: bool
          True if we want to display the grid lines on the visualization
      :param prediction_line_width: int
          The width of prediction line.
      :param figsize: optional (width, height) in inches for the entire plot
          :param ax: optional matplotlib "axes" to draw into
      """
      x, y, means, means_range, y_labels = _get_leaf_target_input(
          self.shadow_tree, precision
      )
      colors = adjust_colors(colors)
      if ax is None:
          if figsize is None:
              figsize = (
                  (np.log(len(y_labels)), np.log(len(y_labels)) * 1.5)
                  if figsize is None
                  else figsize
              )
          fig, ax = plt.subplots(1, 1, figsize=figsize)
  
      ax.set_xlim(min(y), max(y) + 10)
      ax.set_ylim(-1, len(y_labels))
      ax.set_yticks(np.arange(0, len(y_labels), 1))
      ax.set_yticklabels([])
      ax.scatter(
          y,
          x,
          marker="o",
          alpha=colors["scatter_marker_alpha"] - 0.2,
          c=colors["scatter_marker"],
          s=markersize,
          edgecolor=colors["scatter_edge"],
          lw=0.3,
      )
  
      if show_leaf_labels:
          for i in range(len(y_labels)):
              ax.text(max(y) + 10, i - 0.15, y_labels[i])
          ax.text(
              max(y) + 10,
              len(y_labels) - 0.15,
              self.shadow_tree.target_name.lower(),
          )
  
      for i in range(len(means)):
          ax.plot(
              means[i],
              means_range[i],
              color=colors["split_line"],
              linewidth=prediction_line_width,
          )
  
      _format_axes(
          ax,
          self.shadow_tree.target_name,
          "Leaf IDs",
          colors,
          fontsize=label_fontsize,
          fontname=fontname,
          ticks_fontsize=None,
          grid=grid,
      )
  
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 9 for calling the DTreeVizAPI obj's underlying member method code with example usage: obj.rtree_leaf_distributions(show_leaf_labels, colors, markersize, label_fontsize, fontname, precision, grid, prediction_line_width, figsize, ax) without return types