code: def to_one_hot(dataY):
      
      nc = 1 + np.max(dataY)
      onehot = [np.zeros(nc, dtype=np.int8) for _ in dataY]
      for i, j in enumerate(dataY):
          onehot[i][j] = 1
      return onehot
docs: Convert the vector of labels dataY into one-hot encoding.
  
      :param dataY: vector of labels
      :return: one-hot encoded labels