class_docstr: Approximate Nearest Neighbor Search with ScaNN
  (https://github.com/google-research/google-research/tree/master/scann).
  ScaNN performs vector search in three phases: paritioning, scoring, and rescoring.
  More on the algorithms and parameter description: https://github.com/google-research/google-research/blob/master/scann/docs/algorithms.md
  
  Parameters
  ----------------
  model: object: :obj:`cornac.models.Recommender`, required
      Trained recommender model which to get user/item vectors from.
  
  partition_params: dict, optional
      Parameters for the partitioning phase, to send to the tree() call in ScaNN.
  
  score_params: dict, optional
      Parameters for the scoring phase, to send to the score_ah() call in ScaNN.
      score_brute_force() will be called if score_brute_force is True.
  
  score_brute_force: bool, optional, default: False
      Whether to call score_brute_force() for the scoring phase.
  
  rescore_params: dict, optional
      Parameters for the rescoring phase, to send to the reorder() call in ScaNN.
  
  num_threads: int, optional, default: -1
      Default number of threads used for training. 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.
code: def __init__(
      self,
      model,
      partition_params=None,
      score_params=None,
      score_brute_force=False,
      rescore_params=None,
      num_threads=-1,
      seed=None,
      name="ScaNNANN",
      verbose=False,
  ):
      super().__init__(model=model, name=name, verbose=verbose)
  
      if partition_params is None:
          partition_params = {
              "num_leaves": 100,
              "num_leaves_to_search": 50,
          }
  
      if score_params is None:
          score_params = {
              "dimensions_per_block": 2,
              "anisotropic_quantization_threshold": 0.2,
          }
  
      if rescore_params is None:
          rescore_params = {"reordering_num_neighbors": 100}
  
      self.partition_params = partition_params
      self.score_params = score_params
      self.score_brute_force = score_brute_force
      self.rescore_params = rescore_params
      self.num_threads = (
          num_threads
          if num_threads != -1
          else multiprocessing.cpu_count()
      )
      self.seed = seed
  
      self.index = None
      self.ignored_attrs.extend(
          [
              "index",  # will be saved separately
              "item_vectors",  # redundant after index is built
          ]
      )
  
file_path: cornac/cornac/models/ann/recom_ann_scann.py
imports: import os
  import multiprocessing
  import numpy
  from ..recommender import MEASURE_L2, MEASURE_DOT, MEASURE_COSINE
  from .recom_ann_base import BaseANN
label_desc: Use image node_id 1 to create a new ScaNNANN object from inherited base classes: BaseANN with example: obj = ScaNNANN(model, partition_params, score_params, score_brute_force, rescore_params, num_threads, seed, name, verbose)