code: def analyze_problem_type_array(y_train, verbose=0):
      y_train = copy.deepcopy(y_train)
      cat_limit = 30  ### this determines the number of categories to name integers as classification ##
      float_limit = 15  ### this limits the number of float variable categories for it to become cat var
      if y_train.ndim <= 1:
          multi_label = False
      else:
          multi_label = True
      ####  This is where you detect what kind of problem it is #################
      if not multi_label:
          if y_train.dtype in ["int64", "int32", "int16"]:
              if len(np.unique(y_train)) <= 2:
                  model_class = "Binary_Classification"
              elif (
                  len(np.unique(y_train)) > 2
                  and len(np.unique(y_train)) <= cat_limit
              ):
                  model_class = "Multi_Classification"
              else:
                  model_class = "Regression"
          elif y_train.dtype in ["float16", "float32", "float64"]:
              if len(np.unique(y_train)) <= 2:
                  model_class = "Binary_Classification"
              elif (
                  len(np.unique(y_train)) > 2
                  and len(np.unique(y_train)) <= float_limit
              ):
                  model_class = "Multi_Classification"
              else:
                  model_class = "Regression"
          else:
              if len(np.unique(y_train)) <= 2:
                  model_class = "Binary_Classification"
              else:
                  model_class = "Multi_Classification"
      else:
          for i in range(
              y_train.shape[1]
          ):  # Iterate over columns, not dimensions
              ### Test dtypes for each target column ###
              if y_train.iloc[:, i].dtype in [
                  "int64",
                  "int32",
                  "int16",
              ]:
                  unique_values = np.unique(
                      y_train.iloc[:, i]
                  )  # Use np.unique for NumPy arrays
                  if len(unique_values) <= 2:
                      model_class = "Binary_Classification"
                  elif (
                      len(unique_values) > 2
                      and len(unique_values) <= cat_limit
                  ):
                      model_class = "Multi_Classification"
                  else:
                      model_class = "Regression"
              elif y_train.iloc[:, i].dtype in [
                  "float16",
                  "float32",
                  "float64",
              ]:
                  if len(np.unique(y_train.iloc[:, 0])) <= 2:
                      model_class = "Binary_Classification"
                  elif (
                      len(np.unique(y_train.iloc[:, 0])) > 2
                      and len(np.unique(y_train.iloc[:, 0]))
                      <= float_limit
                  ):
                      model_class = "Multi_Classification"
                  else:
                      model_class = "Regression"
              else:
                  if len(np.unique(y_train.iloc[:, 0])) <= 2:
                      model_class = "Binary_Classification"
                  else:
                      model_class = "Multi_Classification"
      ########### print this for the start of next step ###########
      if verbose:
          if multi_label:
              print(
                  """    %s %s problem """
                  % ("Multi_Label", model_class)
              )
          else:
              print(
                  """    %s %s problem """
                  % ("Single_Label", model_class)
              )
      return model_class, multi_label
  
imports: import copy
  import numpy
  import pandas
  import matplotlib.pyplot
  from sklearn.metrics import mean_squared_error
  from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor
  from tensorflow.keras.callbacks import LearningRateScheduler, ReduceLROnPlateau
  from tensorflow.keras.callbacks import EarlyStopping, ModelCheckpoint
  from tensorflow.keras.utils import to_categorical
  import pdb
  from sklearn.metrics import accuracy_score, balanced_accuracy_score, average_precision_score, f1_score, mean_squared_error
  from sklearn.utils import shuffle
  import numpy
  from sklearn.utils import shuffle
  import copy
  from tensorflow.keras.callbacks import ReduceLROnPlateau
  import matplotlib.pyplot
  import tensorflow
  from collections import OrderedDict
  from collections import Counter
  from sklearn.utils.class_weight import compute_class_weight
  import copy
  from tensorflow.keras.callbacks import EarlyStopping, ModelCheckpoint, Callback
  from sklearn.base import BaseEstimator, TransformerMixin
  from tensorflow.keras.optimizers import Adam
  from tensorflow.keras.layers import Dense, Dropout, BatchNormalization, Activation
  from tensorflow.keras.models import Sequential, Model
  from tensorflow.keras.regularizers import l1_l2
  from tensorflow.keras.callbacks import EarlyStopping, ModelCheckpoint, LearningRateScheduler
  from sklearn.metrics import balanced_accuracy_score, classification_report
  import numpy
  import tensorflow
  from tensorflow.keras.layers import Input, Dense, BatchNormalization, Activation, Dropout
  from tensorflow.keras.models import Sequential
  from tensorflow.keras.regularizers import l1_l2
  from tensorflow.keras.metrics import Metric
  import time
label_desc: Use image node_id 1 for calling a global function with example usage: analyze_problem_type_array(y_train, verbose) and returns: model_class,  multi_label