code: def class_proportions(y_train, y_test, labels):
      # Get the unique values from the dataset
      targets = (y_train,) if y_test is None else (y_train, y_test)
      class_ids = np.array(unique_labels(*targets))
  
      # Compute the class counts
      counts_train = np.array([(y_train == c).sum() for c in class_ids])
      counts_test = np.array([(y_test == c).sum() for c in class_ids])
  
      class_column, dataset_column, count_column = make_columns(
          class_ids, counts_train, counts_test
      )
  
      if labels is not None and (
          isinstance(class_column[0], int)
          or isinstance(class_column[0], np.integer)
      ):
          class_column = get_named_labels(labels, class_column)
  
      table = make_table(class_column, dataset_column, count_column)
      chart = wandb.visualize("wandb/class_proportions/v1", table)
  
      return chart
  
file_path: wandb/wandb/sklearn/calculate/class_proportions.py
imports: from warnings import simplefilter
  import numpy
  from sklearn.utils.multiclass import unique_labels
  import wandb
  from wandb.sklearn import utils
label_desc: Use image node_id 1 for calling a global function with example usage: class_proportions(y_train, y_test, labels) and returns: chart