class_docstr: Next Basket Recommendation Evaluation method
  
  Parameters
  ----------
  data: list, required
      Raw preference data in the tuple format [(user_id, baskets)].
  
  test_size: float, optional, default: 0.2
      The proportion of the test set,         if > 1 then it is treated as the size of the test set.
  
  val_size: float, optional, default: 0.0
      The proportion of the validation set,         if > 1 then it is treated as the size of the validation set.
  
  fmt: str, default: 'UBI'
      Format of the input data. Currently, we are supporting:
  
      'UBI': User, Basket, Item
      'UBIT': User, Basket, Item, Timestamp
      'UBITJson': User, Basket, Item, Timestamp, Json
  
  seed: int, optional, default: None
      Random seed for reproducibility.
  
  exclude_unknowns: bool, optional, default: True
      If `True`, unknown items will be ignored during model evaluation.
  
  verbose: bool, optional, default: False
      Output running log.
code: def eval(self, model, test_set, ranking_metrics, **kwargs):
      metric_avg_results = OrderedDict()
      metric_user_results = OrderedDict()
  
      avg_results, user_results = ranking_eval(
          model=model,
          metrics=ranking_metrics,
          train_set=self.train_set,
          test_set=test_set,
          repetition_eval=self.repetition_eval,
          exploration_eval=self.exploration_eval,
          exclude_unknowns=self.exclude_unknowns,
          verbose=self.verbose,
      )
  
      for i, mt in enumerate(ranking_metrics):
          metric_avg_results[mt.name] = avg_results["conventional"][i]
          metric_user_results[mt.name] = user_results["conventional"][i]
  
      if self.repetition_eval:
          for i, mt in enumerate(ranking_metrics):
              metric_avg_results[
                  "{}-rep".format(mt.name)
              ] = avg_results["repetition"][i]
              metric_user_results[
                  "{}-rep".format(mt.name)
              ] = user_results["repetition"][i]
  
      if self.repetition_eval:
          for i, mt in enumerate(ranking_metrics):
              metric_avg_results[
                  "{}-expl".format(mt.name)
              ] = avg_results["exploration"][i]
              metric_user_results[
                  "{}-expl".format(mt.name)
              ] = user_results["exploration"][i]
      return Result(model.name, metric_avg_results, metric_user_results)
  
file_path: cornac/cornac/eval_methods/next_basket_evaluation.py
imports: from collections import OrderedDict
  import numpy
  from tqdm.auto import tqdm
  from .None import RatioSplit
  from ..data import BasketDataset
  from ..experiment.result import Result
  from ..utils.common import safe_indexing
label_desc: Use image node_id 4 for calling the NextBasketEvaluation obj's underlying member method code with example usage: obj.eval(model, test_set, ranking_metrics) and returns: Result