class_docstr: Class that performs the reading of the csv_input and select the lines
  according to the subject id if available
class_docstr_tok: ["Class","that","performs","the","reading","of","the","csv_input","and","select","the","lines","according","to","the","subject","id","if","available"]
docstr: Transformation of labels to categorical
  :param labels: labels to change
  :param label_names:
  :return:
docstr_tok: ["Transformation","of","labels","to","categorical",":","param","labels",":","labels","to","change",":","param","label_names",":",":","return",":"]
code: def to_categorical(labels, label_names):
      """
      Transformation of labels to categorical
      :param labels: labels to change
      :param label_names:
      :return:
      """
      return [
          np.array(list(label_names).index(label)).astype(np.float32)
          for label in labels
      ]
  
imports: import random
  import numpy
  import pandas
  import tensorflow
  from tensorflow.python.data.util import nest
  from niftynet.layer.base_layer import Layer
  from niftynet.io.image_reader import param_to_dict
label_desc: Use image node_id 5 for calling the CSVReader obj's underlying member method code with example usage: obj.to_categorical(labels, label_names) and returns: unknown