code: def feature_split_proportions(
      model: SklearnModel, columns: Optional[List[int]] = None
  ) -> Mapping[int, float]:
      split_variables = []
      for sample in model.model_samples:
          for tree in sample.trees:
              for node in tree.nodes:
                  splitting_var = node.split.splitting_variable
                  split_variables.append(splitting_var)
      counter = Counter(split_variables)
      if columns is None:
          columns = sorted(
              list([x for x in counter.keys() if x is not None])
          )
  
      proportions = {}
      for column in columns:
          if column in counter.keys():
              proportions[column] = counter[column] / len(
                  split_variables
              )
          else:
              proportions[column] = 0.0
  
      return proportions
  
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 1 for calling a global function with example usage: feature_split_proportions(model, columns) and returns: proportions