class_docstr: End to end tests for pysparnn
class_docstr_tok: ["End","to","end","tests","for","pysparnn"]
docstr: Test multiple level indexes
docstr_tok: ["Test","multiple","level","indexes"]
code: def test_levels(self):
      """Test multiple level indexes"""
      features = np.random.binomial(1, 0.01, size=(1000, 20000))
      features = csr_matrix(features)
  
      # build the search index!
      data_to_return = np.array(list(range(1000)), dtype=int)
  
      # matrix size smaller - this forces the index to have multiple levels
      cluster_index = ci.ClusterIndex(
          features, data_to_return, matrix_size=10
      )
  
      ret = cluster_index.search(
          features[0:10], k=1, k_clusters=1, return_distance=False
      )
      self.assertEqual([[x] for x in data_to_return[:10]], ret)
  
file_path: pysparnn/tests/test_pysparnn.py
imports: import unittest
  import pysparnn.cluster_index
  import numpy
  from scipy.sparse import csr_matrix
  from pysparnn.matrix_distance import SlowEuclideanDistance
  from pysparnn.matrix_distance import UnitCosineDistance
  from pysparnn.matrix_distance import DenseCosineDistance
  from sklearn.feature_extraction import DictVectorizer
label_desc: Use image node_id 7 for calling the PysparnnTest obj's underlying member method code with example usage: obj.test_levels() without return types