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: Building index from the base recommender model.
docstr_tok: ["Building","index","from","the","base","recommender","model","."]
code: def build_index(self):
      """Building index from the base recommender model."""
      if not self.model.is_fitted:
          warnings.warn(
              f"Base recommender model {self.model.name} is not fitted!"
          )
  
      # ANN required attributes
      self.measure = copy.deepcopy(self.model.get_vector_measure())
      self.user_vectors = copy.deepcopy(self.model.get_user_vectors())
      self.item_vectors = copy.deepcopy(self.model.get_item_vectors())
  
      self.higher_is_better = self.measure in {
          MEASURE_DOT,
          MEASURE_COSINE,
      }
  
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 3 for calling the BaseANN obj's underlying member method code with example usage: obj.build_index() without return types