code: def null_feature_split_proportions_distribution(
      model: SklearnModel,
      X: Union[pd.DataFrame, np.ndarray],
      y: np.ndarray,
      n_permutations: int = 10,
  ) -> Mapping[int, List[float]]:
      """
      Calculate a null distribution of proportion of splits on each variable in X
  
      Works by randomly permuting y to remove any true dependence of y on X and calculating feature importance
  
      Parameters
      ----------
      model: SklearnModel
          Model specification to work with
      X: np.ndarray
          Covariate matrix
      y: np.ndarray
          Target data
      n_permutations: int
          How many permutations to run
          The higher the number of permutations, the more accurate the null distribution, but the longer it will take to run
      Returns
      -------
      Mapping[int, List[float]]
          A list of inclusion proportions for each variable in X
      """
  
      inclusion_dict = {x: [] for x in range(X.shape[1])}
  
      y_s = [np.random.permutation(y) for _ in range(n_permutations)]
      X_s = [X for _ in y_s]
  
      fit_models = run_models(model, X_s, y_s)
  
      for model in fit_models:
          splits_run = feature_split_proportions(
              model, list(range(X.shape[1]))
          )
          for key, value in splits_run.items():
              inclusion_dict[key].append(value)
  
      return inclusion_dict
  
file_path: imodels/imodels/experimental/bartpy/diagnostics/features.py
imports: from collections import Counter
  from typing import List, Mapping, Union, Optional
  import numpy
  import pandas
  import seaborn
  from matplotlib import pyplot
  from ..runner import run_models
  from ..sklearnmodel import SklearnModel
label_desc: Use image node_id 3 for calling a global function with example usage: null_feature_split_proportions_distribution(model, X, y, n_permutations) and returns: inclusion_dict