code: def multiclass_c45classifiertree(
      train=traindat, test=testdat, labels=label_traindat, ft=feattypes
  ):
      try:
          from shogun import MulticlassLabels, C45ClassifierTree
          from numpy import random, int32
      except ImportError:
          print("Could not import Shogun and/or numpy modules")
          return
      import shogun as sg
  
      # wrap features and labels into Shogun objects
      feats_train = sg.create_features(sg.read_csv(train))
      feats_test = sg.create_features(sg.read_csv(test))
      train_labels = MulticlassLabels(sg.read_csv(labels))
  
      # divide train dataset into training and validation subsets in the ratio 2/3 to 1/3
      subset = int32(random.permutation(feats_train.get_num_vectors()))
      vsubset = subset[1 : int(subset.size / 3)]
      trsubset = subset[1 + int(subset.size / 3) : subset.size]
  
      # C4.5 Tree formation using training subset
      train_labels.add_subset(trsubset)
      feats_train.add_subset(trsubset)
  
      c = C45ClassifierTree()
      c.set_labels(train_labels)
      c.set_feature_types(ft)
      c.train(feats_train)
  
      train_labels.remove_subset()
      feats_train.remove_subset()
  
      # prune tree using validation subset
      train_labels.add_subset(vsubset)
      feats_train.add_subset(vsubset)
  
      c.prune_tree(feats_train, train_labels)
  
      train_labels.remove_subset()
      feats_train.remove_subset()
  
      # Classify test data
      output = c.apply_multiclass(feats_test).get_labels()
      output_certainty = c.get_certainty_vector()
  
      return c, output, output_certainty
  
label_desc: Use image node_id 1 for calling a global function with example usage: multiclass_c45classifiertree(train, test, labels, ft) and returns: c,  output,  output_certainty