code: def load_ratings(data_home, size):
      
  
      if size == '100k':
          with open(os.path.join(data_home, 'u.data'), encoding='ISO-8859-1') as f:
              lines = list(map(lambda l: list(map(int, l.rstrip().split('\t'))), f.readlines()))
      elif size == '1m':
          with open(os.path.join(data_home, 'ratings.dat'), encoding='ISO-8859-1') as f:
              lines = list(map(lambda l: list(map(int, l.rstrip().split('::'))), f.readlines()))
  
      ratings = []
  
      for l in lines:
          # Since we consider positive-only feedback setting, ratings < 5 will be excluded.
          if l[2] == 5:
              ratings.append(l)
  
      ratings = np.asarray(ratings)
  
      # sorted by timestamp
      return ratings[np.argsort(ratings[:, 3])]
docs: Load all samples in the dataset.