code: def __batch_update(self, train_events, test_events, n_epoch):
          
          for epoch in range(n_epoch):
              # SGD requires us to shuffle events in each iteration
              # * if n_epoch == 1
              #   => shuffle is not required because it is a deterministic training (i.e. matrix sketching)
              if n_epoch != 1:
                  np.random.shuffle(train_events)
  
              # train
              for e in train_events:
                  self.rec.update(e, batch_train=True)
  
              # test
              MPR = self.__batch_evaluate(test_events)
              if self.debug:
                  logger.debug('epoch %2d: MPR = %f' % (epoch + 1, MPR))
docs: Batch update called by the fitting method.
  
          Args:
              train_events (list of Event): Positive training events.
              test_events (list of Event): Test events.
              n_epoch (int): Number of epochs for the batch training.