class_docstr: Global Personalized Top Frequent Items.
  
  Parameters
  ----------
  name: string, default: 'GPTop'
      The name of the recommender model.
  
  use_global_popularity: boolean, optional, default: True
      When False, no item frequency from all users' baskets are being used.
  
  use_personalized_popularity: boolean, optional, default: True
      When False, no item frequency from history baskets are being used.
  
  use_quantity: boolean, optional, default: False
      When True, constructing item frequency based on its quantity (getting from extra_data).
      The data must be in fmt 'UBITJson'.
  
  References
  ----------
  Ming Li, Sami Jullien, Mozhdeh Ariannezhad, and Maarten de Rijke. 2023.
  A Next Basket Recommendation Reality Check.
  ACM Trans. Inf. Syst. 41, 4, Article 116 (October 2023), 29 pages. https://doi.org/10.1145/3587153
code: def fit(self, train_set, val_set=None):
      super().fit(train_set=train_set, val_set=val_set)
      if self.use_global_popularity:
          if self.use_quantity:
              self.item_freq = Counter()
              for idx, iid in enumerate(self.train_set.uir_tuple[1]):
                  self.item_freq[iid] += self.train_set.extra_data[
                      idx
                  ].get("quantity", 0)
          else:
              self.item_freq = Counter(self.train_set.uir_tuple[1])
      return self
  
file_path: cornac/cornac/models/gp_top/recom_gp_top.py
imports: import numpy
  from collections import Counter
  from ..recommender import NextBasketRecommender
label_desc: Use image node_id 2 for calling the GPTop obj's underlying member method code with example usage: obj.fit(train_set, val_set) and returns: self