class_docstr: A class for creating SASRec specific dataset used during
  train, validation and testing.
  
  Attributes:
      usernum: integer, total number of users
      itemnum: integer, total number of items
      User: dict, all the users (keys) with items as values
      Items: set of all the items
      user_train: dict, subset of User that are used for training
      user_valid: dict, subset of User that are used for validation
      user_test: dict, subset of User that are used for testing
      col_sep: column separator in the data file
      filename: data filename
class_docstr_tok: ["A","class","for","creating","SASRec","specific","dataset","used","during","train",",","validation","and","testing",".","Attributes",":","usernum",":","integer",",","total","number","of","users","itemnum",":","integer",",","total","number","of","items","User",":","dict",",","all","the","users","(","keys",")","with","items","as","values","Items",":","set","of","all","the","items","user_train",":","dict",",","subset","of","User","that","are","used","for","training","user_valid",":","dict",",","subset","of","User","that","are","used","for","validation","user_test",":","dict",",","subset","of","User","that","are","used","for","testing","col_sep",":","column","separator","in","the","data","file","filename",":","data","filename"]
code: def data_partition(self):
      # assume user/item index starting from 1
      f = open(self.filename, "r")
      for line in f:
          u, i = line.rstrip().split(self.col_sep)
          u = int(u)
          i = int(i)
          self.usernum = max(u, self.usernum)
          self.itemnum = max(i, self.itemnum)
          self.User[u].append(i)
  
      for user in self.User:
          nfeedback = len(self.User[user])
          if nfeedback < 3:
              self.user_train[user] = self.User[user]
              self.user_valid[user] = []
              self.user_test[user] = []
          else:
              self.user_train[user] = self.User[user][:-2]
              self.user_valid[user] = []
              self.user_valid[user].append(self.User[user][-2])
              self.user_test[user] = []
              self.user_test[user].append(self.User[user][-1])
  
imports: from collections import defaultdict
label_desc: Use image node_id 3 for calling the SASRecDataSet obj's underlying member method code with example usage: obj.data_partition() without return types