class_docstr: Class for building, loading and working with Hierarchical Navigable Small World index.
class_docstr_tok: ["Class","for","building",",","loading","and","working","with","Hierarchical","Navigable","Small","World","index","."]
docstr: Build index with given options.
  
  Parameters
  ----------
  pool : Pool
      Pool of vectors for which index will be built.
  
  distance : EDistance
      Distance that should be used for finding nearest vectors.
  
  max_neighbors : int (default=32)
      Maximum number of neighbors that every item can be connected with.
  
  search_neighborhood_size : int (default=300)
      Search neighborhood size for ANN-search.
      Higher values improve search quality in expense of building time.
  
  num_exact_candidates : int (default=100)
      Number of nearest vectors to take from batch.
      Higher values improve search quality in expense of building time.
  
  batch_size : int (default=1000)
      Number of items that added to graph on each step of algorithm.
  
  upper_level_batch_size : int (default=40000)
      Batch size for building upper levels.
  
  level_size_decay : int (default=max_neighbors/2)
      Base of exponent for decaying level sizes.
  
  num_threads : int (default=number of CPUs)
      Number of threads for building index.
  
  report_progress : bool (default=True)
      Print progress of building.
  
  verbose : bool (default=False)
      Print additional information about time of building.
  
  snapshot_file : string (default=None)
      Path for saving snapshots during the index building.
  
  snapshot_interval : int (default=600)
      Interval between saving snapshots (seconds).
      Snapshot is saved after building each level also.
docstr_tok: ["Build","index","with","given","options",".","Parameters","--","--","--","--","--","pool",":","Pool","Pool","of","vectors","for","which","index","will","be","built",".","distance",":","EDistance","Distance","that","should","be","used","for","finding","nearest","vectors",".","max_neighbors",":","int","(","default=32",")","Maximum","number","of","neighbors","that","every","item","can","be","connected","with",".","search_neighborhood_size",":","int","(","default=300",")","Search","neighborhood","size","for","ANN-search",".","Higher","values","improve","search","quality","in","expense","of","building","time",".","num_exact_candidates",":","int","(","default=100",")","Number","of","nearest","vectors","to","take","from","batch",".","Higher","values","improve","search","quality","in","expense","of","building","time",".","batch_size",":","int","(","default=1000",")","Number","of","items","that","added","to","graph","on","each","step","of","algorithm",".","upper_level_batch_size",":","int","(","default=40000",")","Batch","size","for","building","upper","levels",".","level_size_decay",":","int","(","default=max_neighbors\/2",")","Base","of","exponent","for","decaying","level","sizes",".","num_threads",":","int","(","default=number","of","CPUs",")","Number","of","threads","for","building","index",".","report_progress",":","bool","(","default=True",")","Print","progress","of","building",".","verbose",":","bool","(","default=False",")","Print","additional","information","about","time","of","building",".","snapshot_file",":","string","(","default=None",")","Path","for","saving","snapshots","during","the","index","building",".","snapshot_interval",":","int","(","default=600",")","Interval","between","saving","snapshots","(","seconds",")",".","Snapshot","is","saved","after","building","each","level","also","."]
code: def build(
      self,
      pool,
      distance,
      max_neighbors=None,
      search_neighborhood_size=None,
      num_exact_candidates=None,
      batch_size=None,
      upper_level_batch_size=None,
      level_size_decay=None,
      num_threads=None,
      verbose=False,
      report_progress=True,
      snapshot_file=None,
      snapshot_interval=None,
  ):
      """
      Build index with given options.
  
      Parameters
      ----------
      pool : Pool
          Pool of vectors for which index will be built.
  
      distance : EDistance
          Distance that should be used for finding nearest vectors.
  
      max_neighbors : int (default=32)
          Maximum number of neighbors that every item can be connected with.
  
      search_neighborhood_size : int (default=300)
          Search neighborhood size for ANN-search.
          Higher values improve search quality in expense of building time.
  
      num_exact_candidates : int (default=100)
          Number of nearest vectors to take from batch.
          Higher values improve search quality in expense of building time.
  
      batch_size : int (default=1000)
          Number of items that added to graph on each step of algorithm.
  
      upper_level_batch_size : int (default=40000)
          Batch size for building upper levels.
  
      level_size_decay : int (default=max_neighbors/2)
          Base of exponent for decaying level sizes.
  
      num_threads : int (default=number of CPUs)
          Number of threads for building index.
  
      report_progress : bool (default=True)
          Print progress of building.
  
      verbose : bool (default=False)
          Print additional information about time of building.
  
      snapshot_file : string (default=None)
          Path for saving snapshots during the index building.
  
      snapshot_interval : int (default=600)
          Interval between saving snapshots (seconds).
          Snapshot is saved after building each level also.
      """
      params = {}
      not_params = [
          "not_params",
          "self",
          "params",
          "__class__",
          "pool",
          "distance",
      ]
      for key, value in iteritems(locals()):
          if key not in not_params and value is not None:
              params[key] = value
      self._index = _HnswDenseVectorIndex[pool.dtype](
          pool._storage, distance
      )
      with log_fixup():
          self._index._build(json.dumps(params))
  
imports: import sys
  import os
  from six import iteritems
  from enum import IntEnum
  from contextlib import contextmanager
  import json
label_desc: Use image node_id 2 for calling the Hnsw obj's underlying member method code with example usage: obj.build(pool, distance, max_neighbors, search_neighborhood_size, num_exact_candidates, batch_size, upper_level_batch_size, level_size_decay, num_threads, verbose, report_progress, snapshot_file, snapshot_interval) without return types