code: def test_random_discretized_projections(self):
      dim = 4
      vector_count = 5000
      vectors = numpy.random.randn(dim, vector_count)
  
      # First get recall and precision for one 1-dim random hash
      rdp = RandomDiscretizedProjections("rdp", 1, 0.01)
      nearest = NearestFilter(10 + 1)
      engine = Engine(dim, lshashes=[rdp], vector_filters=[nearest])
      exp = RecallPrecisionExperiment(10, vectors)
      result = exp.perform_experiment([engine])
  
      recall1 = result[0][0]
      precision1 = result[0][1]
      searchtime1 = result[0][2]
  
      print(
          "\nRecall RDP: %f, Precision RDP: %f, SearchTime RDP: %f\n"
          % (recall1, precision1, searchtime1)
      )
  
      # Then get recall and precision for one 4-dim random hash
      rdp = RandomDiscretizedProjections("rdp", 2, 0.2)
      engine = Engine(dim, lshashes=[rdp], vector_filters=[nearest])
      result = exp.perform_experiment([engine])
  
      recall2 = result[0][0]
      precision2 = result[0][1]
      searchtime2 = result[0][2]
  
      print(
          "\nRecall RDP: %f, Precision RDP: %f, SearchTime RDP: %f\n"
          % (recall2, precision2, searchtime2)
      )
  
      # Many things are random here, but the precision should increase
      # with dimension
      self.assertTrue(precision2 > precision1)
  
file_path: NearPy/tests/experiments_tests.py
imports: from __future__ import print_function
  import numpy
  import unittest
  from nearpy.experiments import RecallPrecisionExperiment
  from nearpy.hashes import UniBucket, RandomDiscretizedProjections, RandomBinaryProjections, PCABinaryProjections
  from nearpy.filters import NearestFilter, UniqueFilter
  from nearpy.distances import CosineDistance, EuclideanDistance
  from nearpy import Engine
label_desc: Use image node_id 8 for calling the TestRecallExperiment obj's underlying member method code with example usage: obj.test_random_discretized_projections() without return types