code: def infer_output_dim(y_train):
      """
      Infer output_dim from targets
  
      Parameters
      ----------
      y_train : np.array
          Training targets
  
      Returns
      -------
      output_dim : int
          Number of classes for output
      train_labels : list
          Sorted list of initial classes
      """
      check_unique_type(y_train)
      train_labels = unique_labels(y_train)
      output_dim = len(train_labels)
  
      return output_dim, train_labels
  
imports: from collections.abc import Sequence
  from itertools import chain
  from scipy.sparse import issparse
  from scipy.sparse.base import spmatrix
  from scipy.sparse import dok_matrix
  from scipy.sparse import lil_matrix
  import scipy.sparse
  import numpy
  import pandas
label_desc: Use image node_id 11 for calling a global function with example usage: infer_output_dim(y_train) and returns: output_dim,  train_labels