code: def plot_across_chains(
      model: SklearnModel,
      ax=None,
      title="Across Chain Variation",
      x_label=False,
      X=None,
      y=None,
  ):
      if ax is None:
          _, ax = plt.subplots(1, 1)
      n_chains = model.n_chains
  
      preds = []
      mat = np.zeros(shape=(n_chains, n_chains))
  
      for c in range(n_chains):
          preds.append(model.predict_chain(X, c))
      for c_i, c_j in itertools.combinations(range(n_chains), 2):
          mat[c_i, c_j] = mean_squared_error(preds[c_i], preds[c_j])
          mat[c_j, c_i] = mean_squared_error(preds[c_i], preds[c_j])
      ax.matshow(mat)
      for c_i, c_j in itertools.combinations(range(n_chains), 2):
          c = np.round(mat[c_i, c_j], 2)
          ax.text(c_i, c_j, c, va="center", ha="center")
          ax.text(c_j, c_i, c, va="center", ha="center")
      ax.set_xlabel("mean squared distance between predictions")
  
      ax.legend()
      ax.set_title(
          f"{title} (Between Chains Var {np.round(model.between_chains_var(X), 2)})"
      )
      return ax
  
imports: import argparse
  import itertools
  import os
  from functools import partial
  import numpy
  import pandas
  import matplotlib.pyplot
  from matplotlib import cm
  from tqdm import tqdm
  from sklearn import model_selection, datasets
  from sklearn.metrics import mean_squared_error
  from imodels import get_clean_dataset
  from imodels.experimental.bartpy.model import Model
  from imodels.experimental.bartpy.tree import Tree
  from ..sklearnmodel import BART, SklearnModel
label_desc: Use image node_id 7 for calling a global function with example usage: plot_across_chains(model, ax, title, x_label, X, y) and returns: ax