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 _build_datasets(self, train_data, test_data, val_data=None):
      self.train_set = BasketDataset.build(
          data=train_data,
          fmt=self.fmt,
          global_uid_map=self.global_uid_map,
          global_iid_map=self.global_iid_map,
          seed=self.seed,
          exclude_unknowns=False,
      )
      if self.verbose:
          print("---")
          print("Training data:")
          print("Number of users = {}".format(self.train_set.num_users))
          print("Number of items = {}".format(self.train_set.num_items))
          print(
              "Number of baskets = {}".format(
                  self.train_set.num_baskets
              )
          )
  
      self.test_set = BasketDataset.build(
          data=test_data,
          fmt=self.fmt,
          global_uid_map=self.global_uid_map,
          global_iid_map=self.global_iid_map,
          seed=self.seed,
          exclude_unknowns=self.exclude_unknowns,
      )
      if self.verbose:
          print("---")
          print("Test data:")
          print(
              "Number of users = {}".format(len(self.test_set.uid_map))
          )
          print(
              "Number of items = {}".format(len(self.test_set.iid_map))
          )
          print(
              "Number of baskets = {}".format(self.test_set.num_baskets)
          )
          print(
              "Number of unknown users = {}".format(
                  self.test_set.num_users - self.train_set.num_users
              )
          )
          print(
              "Number of unknown items = {}".format(
                  self.test_set.num_items - self.train_set.num_items
              )
          )
  
      if val_data is not None and len(val_data) > 0:
          self.val_set = BasketDataset.build(
              data=val_data,
              fmt=self.fmt,
              global_uid_map=self.global_uid_map,
              global_iid_map=self.global_iid_map,
              seed=self.seed,
              exclude_unknowns=self.exclude_unknowns,
          )
          if self.verbose:
              print("---")
              print("Validation data:")
              print(
                  "Number of users = {}".format(
                      len(self.val_set.uid_map)
                  )
              )
              print(
                  "Number of items = {}".format(
                      len(self.val_set.iid_map)
                  )
              )
              print(
                  "Number of baskets = {}".format(
                      self.val_set.num_baskets
                  )
              )
  
      self.total_baskets = (
          0 if self.val_set is None else self.val_set.num_baskets
      )
      self.total_baskets += (
          self.test_set.num_baskets + self.train_set.num_baskets
      )
      if self.verbose:
          print("---")
          print("Total users = {}".format(self.total_users))
          print("Total items = {}".format(self.total_items))
          print("Total baskets = {}".format(self.total_baskets))
  
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 3 for calling the NextBasketEvaluation obj's underlying member method code with example usage: obj._build_datasets(train_data, test_data, val_data) without return types