class_docstr: Approximate Nearest Neighbor Search with Annoy (https://github.com/spotify/annoy).
  
  Parameters
  ----------------
  model: object: :obj:`cornac.models.Recommender`, required
      Trained recommender model which to get user/item vectors from.
  
  n_trees: int, default: 100
      The number of trees used to build index. It affects the build time and the
      index size. A larger value will give more accurate results, but larger indexes.
  
  search_k: int, default: 50
      Parameter controls the search performance and runtime. A larger value will
      give more accurate results, but will take longer time to return.
  
  num_threads: int, optional, default: -1
      Default number of threads used for building index. If num_threads = -1,
      all cores will be used.
  
  seed: int, optional, default: None
      Random seed for reproducibility.
  
  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.
code: def build_index(self):
      """Building index from the base recommender model."""
      super().build_index()
  
      from annoy import AnnoyIndex
  
      assert self.measure in SUPPORTED_MEASURES
  
      self.index = AnnoyIndex(
          self.item_vectors.shape[1], SUPPORTED_MEASURES[self.measure]
      )
  
      if self.seed is not None:
          self.index.set_seed(self.seed)
  
      for i, v in enumerate(self.item_vectors):
          self.index.add_item(i, v)
  
      self.index.build(self.n_trees, n_jobs=self.num_threads)
  
file_path: cornac/cornac/models/ann/recom_ann_annoy.py
imports: import numpy
  from ..recommender import MEASURE_L2, MEASURE_DOT, MEASURE_COSINE
  from .recom_ann_base import BaseANN
label_desc: Use image node_id 2 for calling the AnnoyANN obj's underlying member method code with example usage: obj.build_index() without return types