code: def data_with_categorical_target(with_nan: bool = False):
      """
      Generate dataset for classification task where target column is defined as
      string categories (e.g. 'red', 'green'). Dataset is generated so that when
      split into training and test in the test sample in the target will always
      be a new category.
  
      :param with_nan: is there a need to generate target column with np.nan
      """
      task = Task(TaskTypesEnum.classification)
      features = np.array([[0, 0], [0, 1], [8, 8], [8, 9]])
      if with_nan:
          target = np.array(
              ["blue", np.nan, np.nan, "di"], dtype=object
          )
      else:
          target = np.array(["blue", "da", "ba", "di"], dtype=str)
      train_input = InputData(
          idx=np.array([0, 1, 2, 3]),
          features=features,
          target=target,
          task=task,
          data_type=DataTypesEnum.table,
          supplementary_data=SupplementaryData(),
      )
  
      return train_input
  
imports: import numpy
  from fedot import Fedot
  from fedot.core.data.data import InputData
  from fedot.core.data.data_split import train_test_data_setup
  from fedot.core.data.supplementary_data import SupplementaryData
  from fedot.core.repository.dataset_types import DataTypesEnum
  from fedot.core.repository.tasks import Task, TaskTypesEnum
  from fedot.preprocessing.data_types import TYPE_TO_ID
label_desc: Use image node_id 6 for calling a global function with example usage: data_with_categorical_target(with_nan) and returns: train_input