class_docstr: User Popularity-based CF (UPCF)
  
  Parameters
  ----------
  name: string, default: 'UPCF'
      The name of the recommender model.
  
  recency: int, optional, default: 1
      The size of recency window.
      If 0, all baskets will be used.
  
  locality: int, optional, default: 1
      The strength we enforce the similarity between two items within a basket
  
  asymmetry: float, optional, default: 0.25
      Trade-off parameter which balances the importance of the probability of having item i given j and probability having item j given i.
      This value will be computed via `similaripy.asymetric_cosine`.
  
  verbose: boolean, optional, default: False
      When True, running logs are displayed.
  
  References
  ----------
  Guglielmo Faggioli, Mirko Polato, and Fabio Aiolli. 2020.
  Recency Aware Collaborative Filtering for Next Basket Recommendation.
  In Proceedings of the 28th ACM Conference on User Modeling, Adaptation and Personalization (UMAP '20). Association for Computing Machinery, New York, NY, USA, 80–87. https://doi.org/10.1145/3340631.3394850
code: def score(self, user_idx, history_baskets, **kwargs):
      import similaripy as sim
  
      items = list(set(itertools.chain.from_iterable(history_baskets)))
      current_user_item_matrix = csr_matrix(
          (np.ones(len(items)), (np.zeros(len(items)), items)),
          shape=(1, self.total_items),
          dtype="float32",
      )
      current_user_wise_popularity = self._get_user_wise_popularity(
          history_baskets
      )
      user_wise_popularity = vstack(
          [current_user_wise_popularity, self.user_wise_popularity]
      )
      user_item_matrix = vstack(
          [current_user_item_matrix, self.user_item_matrix]
      )
      user_sim = sim.asymmetric_cosine(
          user_item_matrix,
          alpha=self.asymmetry,
          target_rows=[0],
          verbose=False,
      )
      scores = (
          sim.dot_product(
              user_sim.power(self.locality).tocsr()[0],
              user_wise_popularity,
              verbose=False,
          )
          .toarray()
          .squeeze()
      )
  
      return scores
  
file_path: cornac/cornac/models/upcf/recom_upcf.py
imports: import itertools
  import numpy
  from scipy.sparse import csr_matrix, vstack
  from ..recommender import NextBasketRecommender
label_desc: Use image node_id 4 for calling the UPCF obj's underlying member method code with example usage: obj.score(user_idx, history_baskets) and returns: scores