code: def test_multilabel(self):
      X, Y = synthetic_multilabel()
      self.assertTrue(U.is_multilabel((X, Y)))
      MAXLEN = 7
      MAXFEATURES = 4
      NUM_CLASSES = 4
      model = Sequential()
      model.add(Embedding(MAXFEATURES + 1, 50, input_length=MAXLEN))
      model.add(GlobalAveragePooling1D())
      model.add(Dense(NUM_CLASSES, activation="sigmoid"))
      model.compile(
          loss="binary_crossentropy",
          optimizer="adam",
          metrics=["accuracy"],
      )
      learner = ktrain.get_learner(
          model, train_data=(X, Y), val_data=(X, Y), batch_size=1
      )
      learner.lr_find(max_epochs=5)  # use max_epochs until TF 2.4
  
      # use loss instead of accuracy due to: https://github.com/tensorflow/tensorflow/issues/41114
      hist = learner.fit(0.001, 200)
      learner.view_top_losses(n=5)
      learner.validate()
      # final_acc = hist.history[VAL_ACC_NAME][-1]
      # print('final_accuracy:%s' % (final_acc))
      # self.assertGreater(final_acc, 0.97)
  
      final_loss = hist.history["val_loss"][-1]
      print("final_loss:%s" % (final_loss))
      self.assertLess(final_loss, 0.05)
  
file_path: ktrain/tests/test_multilabel.py
imports: from unittest import TestCase, main, skip
  import numpy
  import testenv
  import ktrain
  from ktrain import utils
  from ktrain.imports import ACC_NAME, VAL_ACC_NAME
label_desc: Use image node_id 1 for calling the TestMultilabel obj's underlying member method code with example usage: obj.test_multilabel() without return types