class_docstr: Temporal-Item-Frequency-based User-KNN (TIFUKNN)
  
  Parameters
  ----------
  name: string, default: 'TIFUKNN'
      The name of the recommender model.
  
  n_neighbors: int, optional, default: 300
      The number of neighbors for KNN
  
  within_decay_rate: float, optional, default: 0.9
      Within-basket time-decayed ratio in range [0, 1]
  
  group_decay_rate: float, optional, default: 0.7
      Group time-decayed ratio in range [0, 1]
  
  alpha: float, optional, default: 0.7
      The trade-off between current user vector and neighbors vectors
      to compute final item scores
  
  n_groups: int, optional, default: 7
      The historal baskets will be partition into `n_groups` equally.
  
  verbose: boolean, optional, default: False
      When True, running logs are displayed.
  
  References
  ----------
  Haoji Hu, Xiangnan He, Jinyang Gao, and Zhi-Li Zhang. 2020.
  Modeling Personalized Item Frequency Information for Next-basket Recommendation.
  In Proceedings of the 43rd International ACM SIGIR Conference on Research and Development in Information Retrieval (SIGIR '20). Association for Computing Machinery, New York, NY, USA, 1071–1080. https://doi.org/10.1145/3397271.3401066
class_docstr_tok: ["Temporal-Item-Frequency-based","User-KNN","(","TIFUKNN",")","Parameters","--","--","--","--","--","name",":","string",",","default",":","'TIFUKNN'","The","name","of","the","recommender","model",".","n_neighbors",":","int",",","optional",",","default",":","300","The","number","of","neighbors","for","KNN","within_decay_rate",":","float",",","optional",",","default",":","0.9","Within-basket","time-decayed","ratio","in","range","[","0",",","1","]","group_decay_rate",":","float",",","optional",",","default",":","0.7","Group","time-decayed","ratio","in","range","[","0",",","1","]","alpha",":","float",",","optional",",","default",":","0.7","The","trade-off","between","current","user","vector","and","neighbors","vectors","to","compute","final","item","scores","n_groups",":","int",",","optional",",","default",":","7","The","historal","baskets","will","be","partition","into","`","n_groups","`","equally",".","verbose",":","boolean",",","optional",",","default",":","False","When","True",",","running","logs","are","displayed",".","References","--","--","--","--","--","Haoji","Hu",",","Xiangnan","He",",","Jinyang","Gao",",","and","Zhi-Li","Zhang",".","2020",".","Modeling","Personalized","Item","Frequency","Information","for","Next-basket","Recommendation",".","In","Proceedings","of","the","43rd","International","ACM","SIGIR","Conference","on","Research","and","Development","in","Information","Retrieval","(","SIGIR","'20",")",".","Association","for","Computing","Machinery",",","New","York",",","NY",",","USA",",","1071\u20131080",".","https",":","\/\/doi.org\/10.1145\/3397271.3401066"]
code: def score(self, user_idx, history_baskets, **kwargs):
      if len(history_baskets) == 0:
          return np.zeros(self.total_items, dtype="float32")
      user_vector = self._compute_user_vector(history_baskets)
      _, indices = self.tree.query([user_vector], k=self.n_neighbors)
      return self.alpha * user_vector + (1 - self.alpha) * np.mean(
          self.user_vectors[indices.squeeze()]
      )
  
file_path: cornac/cornac/models/tifuknn/recom_tifuknn.py
imports: import warnings
  from time import time
  import numpy
  from tqdm import tqdm
  from ..recommender import NextBasketRecommender
label_desc: Use image node_id 6 for calling the TIFUKNN obj's underlying member method code with example usage: obj.score(user_idx, history_baskets) and returns: unknown, np