code: def test_compile_fit(self):
      def gen_rand_user_item_feature(user_num, item_num, class_num):
          user_id = random.randint(1, user_num)
          item_id = random.randint(1, item_num)
          rating = random.randint(1, class_num)
          sample = Sample.from_ndarray(
              np.array([user_id, item_id]), np.array([rating])
          )
          return UserItemFeature(user_id, item_id, sample)
  
      model = NeuralCF(200, 80, 5)
      model.summary()
      data = (
          self.sc.parallelize(range(0, 50))
          .map(lambda i: gen_rand_user_item_feature(200, 80, 5))
          .map(lambda pair: pair.sample)
      )
      model.compile(
          optimizer="adam",
          loss=SparseCategoricalCrossEntropy(zero_based_label=False),
          metrics=["accuracy"],
      )
      tmp_log_dir = create_tmp_path()
      model.set_tensorboard(tmp_log_dir, "training_test")
      model.fit(data, nb_epoch=1, batch_size=32, validation_data=data)
      train_loss = model.get_train_summary("Loss")
      val_loss = model.get_validation_summary("Loss")
      val_acc = model.get_validation_summary("Top1Accuracy")
      assert len(val_acc) != 0
      assert len(train_loss) != 0
      assert len(val_loss) != 0
  
file_path: analytics-zoo/pyzoo/test/zoo/models/recommendation/test_neuralcf.py
imports: import pytest
  import random
  from zoo.pipeline.api.keras.layers import *
  from zoo.models.recommendation import UserItemFeature
  from zoo.models.recommendation import NeuralCF
  from test.zoo.pipeline.utils.test_utils import ZooTestCase
label_desc: Use image node_id 5 for calling the TestNeuralCF obj's underlying member method code with example usage: obj.test_compile_fit() and returns: UserItemFeature