class_docstr: Base class for a recommender model supporting Approximate Nearest Neighbor (ANN) search.
  
  Parameters
  ----------------
  model: object: :obj:`cornac.models.Recommender`, required
      Trained recommender model which to get user/item vectors from.
  
  name: str, required
      Name of the recommender model.
  
  verbose: boolean, optional, default: False
      When True, running logs are displayed.
class_docstr_tok: ["Base","class","for","a","recommender","model","supporting","Approximate","Nearest","Neighbor","(","ANN",")","search",".","Parameters","--","--","--","--","--","--","--","--","model",":","object",":",":","obj",":","`","cornac.models.Recommender","`",",","required","Trained","recommender","model","which","to","get","user\/item","vectors","from",".","name",":","str",",","required","Name","of","the","recommender","model",".","verbose",":","boolean",",","optional",",","default",":","False","When","True",",","running","logs","are","displayed","."]
docstr: Generate top-K item recommendations for a given user. Backward compatibility.
  
  Parameters
  ----------
  user_id: str, required
      The original ID of user.
  
  k: int, optional, default=-1
      Cut-off length for recommendations, k=-1 will return ranked list of all items.
  
  remove_seen: bool, optional, default: False
      Remove seen/known items during training and validation from output recommendations.
      This might shrink the list of recommendations to be less than k.
  
  train_set: :obj:`cornac.data.Dataset`, optional, default: None
      Training dataset needs to be provided in order to remove seen items.
  
  Returns
  -------
  recommendations: list
      Recommended items in the form of their original IDs.
docstr_tok: ["Generate","top-K","item","recommendations","for","a","given","user",".","Backward","compatibility",".","Parameters","--","--","--","--","--","user_id",":","str",",","required","The","original","ID","of","user",".","k",":","int",",","optional",",","default=-1","Cut-off","length","for","recommendations",",","k=-1","will","return","ranked","list","of","all","items",".","remove_seen",":","bool",",","optional",",","default",":","False","Remove","seen\/known","items","during","training","and","validation","from","output","recommendations",".","This","might","shrink","the","list","of","recommendations","to","be","less","than","k.","train_set",":",":","obj",":","`","cornac.data.Dataset","`",",","optional",",","default",":","None","Training","dataset","needs","to","be","provided","in","order","to","remove","seen","items",".","Returns","--","--","--","-","recommendations",":","list","Recommended","items","in","the","form","of","their","original","IDs","."]
code: def recommend(self, user_id, k=-1, remove_seen=False, train_set=None):
      """Generate top-K item recommendations for a given user. Backward compatibility.
  
      Parameters
      ----------
      user_id: str, required
          The original ID of user.
  
      k: int, optional, default=-1
          Cut-off length for recommendations, k=-1 will return ranked list of all items.
  
      remove_seen: bool, optional, default: False
          Remove seen/known items during training and validation from output recommendations.
          This might shrink the list of recommendations to be less than k.
  
      train_set: :obj:`cornac.data.Dataset`, optional, default: None
          Training dataset needs to be provided in order to remove seen items.
  
      Returns
      -------
      recommendations: list
          Recommended items in the form of their original IDs.
      """
      assert isinstance(user_id, str)
      return self.recommend_batch(
          batch_users=[user_id],
          k=k,
          remove_seen=remove_seen,
          train_set=train_set,
      )[0]
  
file_path: cornac/cornac/models/ann/recom_ann_base.py
imports: import copy
  import warnings
  import numpy
  from ..recommender import Recommender
  from ..recommender import is_ann_supported
  from ..recommender import MEASURE_DOT, MEASURE_COSINE
label_desc: Use image node_id 6 for calling the BaseANN obj's underlying member method code with example usage: obj.recommend(user_id, k, remove_seen, train_set) and returns: self