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 _split(self):
      user_arr = [u for (u, *_) in self.data]
      all_users = np.unique(user_arr)
      self.rng.shuffle(all_users)
  
      train_users = set(all_users[: self.train_size])
      test_users = set(all_users[-self.test_size :])
      val_users = set(all_users[self.train_size : -self.test_size])
  
      train_idx = [
          i for i, u in enumerate(user_arr) if u in train_users
      ]
      test_idx = [i for i, u in enumerate(user_arr) if u in test_users]
      val_idx = [i for i, u in enumerate(user_arr) if u in val_users]
  
      train_data = safe_indexing(self.data, train_idx)
      test_data = safe_indexing(self.data, test_idx)
      val_data = (
          safe_indexing(self.data, val_idx)
          if len(val_idx) > 0
          else None
      )
  
      self.build(
          train_data=train_data, test_data=test_data, val_data=val_data
      )
  
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 2 for calling the NextBasketEvaluation obj's underlying member method code with example usage: obj._split() without return types