class_docstr: Next Item Recommendation Evaluation method
  
  Parameters
  ----------
  data: list, required
      Raw preference data in the tuple format [(user_id, sessions)].
  
  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: 'SIT'
      Format of the input data. Currently, we are supporting:
  
      'SIT': Session, Item, Timestamp
      'USIT': User, Session, Item, Timestamp
      'SITJson': Session, Item, Timestamp, Json
      'USITJson': User, Session, Item, Timestamp, Json
  
  seed: int, optional, default: None
      Random seed for reproducibility.
  
  mode: str, optional, default: 'last'
      Evaluation mode is either 'next' or 'last'.
      If 'last', only evaluate the last item.
      If 'next', evaluate every next item in the sequence,
  
  exclude_unknowns: bool, optional, default: True
      If `True`, unknown items will be ignored during model evaluation.
  
  verbose: bool, optional, default: False
      Output running log.
class_docstr_tok: ["Next","Item","Recommendation","Evaluation","method","Parameters","--","--","--","--","--","data",":","list",",","required","Raw","preference","data","in","the","tuple","format","[","(","user_id",",","sessions",")","]",".","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",":","'SIT'","Format","of","the","input","data",".","Currently",",","we","are","supporting",":","'SIT","'",":","Session",",","Item",",","Timestamp","'USIT","'",":","User",",","Session",",","Item",",","Timestamp","'SITJson","'",":","Session",",","Item",",","Timestamp",",","Json","'USITJson","'",":","User",",","Session",",","Item",",","Timestamp",",","Json","seed",":","int",",","optional",",","default",":","None","Random","seed","for","reproducibility",".","mode",":","str",",","optional",",","default",":","'last'","Evaluation","mode","is","either","'next","'","or","'last","'",".","If","'last","'",",","only","evaluate","the","last","item",".","If","'next","'",",","evaluate","every","next","item","in","the","sequence",",","exclude_unknowns",":","bool",",","optional",",","default",":","True","If","`","True","`",",","unknown","items","will","be","ignored","during","model","evaluation",".","verbose",":","bool",",","optional",",","default",":","False","Output","running","log","."]
docstr: Constructing evaluation method given data.
  
  Parameters
  ----------
  train_data: array-like
      Training data
  
  test_data: array-like
      Test data
  
  val_data: array-like, optional, default: None
      Validation data
  
  fmt: str, default: 'SIT'
      Format of the input data. Currently, we are supporting:
  
      'SIT': Session, Item, Timestamp
      'USIT': User, Session, Item, Timestamp
      'SITJson': Session, Item, Timestamp, Json
      'USITJson': User, Session, Item, Timestamp, Json
  
  rating_threshold: float, default: 1.0
      Threshold to decide positive or negative preferences.
  
  exclude_unknowns: bool, default: False
      Whether to exclude unknown users/items in evaluation.
  
  seed: int, optional, default: None
      Random seed for reproduce the splitting.
  
  verbose: bool, default: False
      The verbosity flag.
  
  Returns
  -------
  method: :obj:`<cornac.eval_methods.NextItemEvaluation>`
      Evaluation method object.
docstr_tok: ["Constructing","evaluation","method","given","data",".","Parameters","--","--","--","--","--","train_data",":","array-like","Training","data","test_data",":","array-like","Test","data","val_data",":","array-like",",","optional",",","default",":","None","Validation","data","fmt",":","str",",","default",":","'SIT'","Format","of","the","input","data",".","Currently",",","we","are","supporting",":","'SIT","'",":","Session",",","Item",",","Timestamp","'USIT","'",":","User",",","Session",",","Item",",","Timestamp","'SITJson","'",":","Session",",","Item",",","Timestamp",",","Json","'USITJson","'",":","User",",","Session",",","Item",",","Timestamp",",","Json","rating_threshold",":","float",",","default",":","1.0","Threshold","to","decide","positive","or","negative","preferences",".","exclude_unknowns",":","bool",",","default",":","False","Whether","to","exclude","unknown","users\/items","in","evaluation",".","seed",":","int",",","optional",",","default",":","None","Random","seed","for","reproduce","the","splitting",".","verbose",":","bool",",","default",":","False","The","verbosity","flag",".","Returns","--","--","--","-","method",":",":","obj",":","`","<","cornac.eval_methods.NextItemEvaluation",">","`","Evaluation","method","object","."]
code: def from_splits(
      cls,
      train_data,
      test_data,
      val_data=None,
      fmt="SIT",
      exclude_unknowns=False,
      seed=None,
      verbose=False,
      **kwargs,
  ):
      """Constructing evaluation method given data.
  
      Parameters
      ----------
      train_data: array-like
          Training data
  
      test_data: array-like
          Test data
  
      val_data: array-like, optional, default: None
          Validation data
  
      fmt: str, default: 'SIT'
          Format of the input data. Currently, we are supporting:
  
          'SIT': Session, Item, Timestamp
          'USIT': User, Session, Item, Timestamp
          'SITJson': Session, Item, Timestamp, Json
          'USITJson': User, Session, Item, Timestamp, Json
  
      rating_threshold: float, default: 1.0
          Threshold to decide positive or negative preferences.
  
      exclude_unknowns: bool, default: False
          Whether to exclude unknown users/items in evaluation.
  
      seed: int, optional, default: None
          Random seed for reproduce the splitting.
  
      verbose: bool, default: False
          The verbosity flag.
  
      Returns
      -------
      method: :obj:`<cornac.eval_methods.NextItemEvaluation>`
          Evaluation method object.
  
      """
      method = cls(
          fmt=fmt,
          exclude_unknowns=exclude_unknowns,
          seed=seed,
          verbose=verbose,
          **kwargs,
      )
  
      return method.build(
          train_data=train_data,
          test_data=test_data,
          val_data=val_data,
      )
  
file_path: cornac/cornac/eval_methods/next_item_evaluation.py
imports: import time
  import warnings
  from collections import OrderedDict, defaultdict
  import numpy
  from tqdm.auto import tqdm
  from ..data import SequentialDataset
  from ..experiment.result import Result
  from ..models import NextItemRecommender
  from .None import BaseMethod
label_desc: Use image node_id 5 for calling the NextItemEvaluation obj's underlying member method code with example usage: obj.from_splits(cls, train_data, test_data, val_data, fmt, exclude_unknowns, seed, verbose) and returns: method