docstr: Build the nearest neighbor index on the training data.
  
  Builds an index on the training data and computes the nearest neighbors
  on the training data.
  
  Returns
  -------
  indices: np.ndarray
  distances: np.ndarray
docstr_tok: ["Build","the","nearest","neighbor","index","on","the","training","data",".","Builds","an","index","on","the","training","data","and","computes","the","nearest","neighbors","on","the","training","data",".","Returns","--","--","--","-","indices",":","np.ndarray","distances",":","np.ndarray"]
code: def build(self):
      """Build the nearest neighbor index on the training data.
  
      Builds an index on the training data and computes the nearest neighbors
      on the training data.
  
      Returns
      -------
      indices: np.ndarray
      distances: np.ndarray
  
      """
  
imports: import logging
  import os
  import warnings
  import numpy
  from scipy.spatial.distance import cdist
  from sklearn import neighbors
  from sklearn.utils import check_random_state
  from openTSNE import utils
label_desc: Use image node_id 2 for calling the KNNIndex obj's underlying member method code with example usage: obj.build() without return types