code: def _predict_proba(model, X):
      """
      This is where we figure out how to get a matrix of k probabilities for a k-class
      classification problem.  It works with any model that answers predict_proba()
      but we can add special cases such as Keras, that has deprecated that method.
      """
      if len(X.shape) == 1:
          X = X.reshape(-1, 1)
      # Keras wants predict not predict_proba and still gives probabilities
      if model.__class__.__module__.startswith(
          "tensorflow.python.keras"
      ) or model.__class__.__module__.startswith("keras"):
          proba = model.predict(X)
          if proba.shape[1] == 1:
              proba = np.hstack(
                  [1 - proba, proba]
              )  # get prob y=0, y=1 nx2 matrix like sklearn
          return proba
  
      # sklearn etc...
      return model.predict_proba(X)
  
file_path: dtreeviz/dtreeviz/classifiers.py
imports: from typing import Tuple
  import matplotlib.pyplot
  import numpy
  import pandas
  from PIL import ImageColor
  from colour import Color
  from matplotlib import patches
  from matplotlib.collections import PatchCollection
  from dtreeviz import utils
  from dtreeviz.colors import adjust_colors
  from dtreeviz.utils import add_classifier_legend, _format_axes
label_desc: Use image node_id 8 for calling a global function with example usage: _predict_proba(model, X) and returns: model, proba