@Test public void testRange() { System.out.println("range"); int[] recall = new int[testx.length]; for (int i = 0; i < testx.length; i++) { ArrayList<Neighbor<double[], double[]>> n1 = new ArrayList<>(); ArrayList<Neighbor<double[], double[]>> n2 = new ArrayList<>(); lsh.range(testx[i], 8.0, n1, 0.95, 50); naive.range(testx[i], 8.0, n2); for (Neighbor m2 : n2) { for (Neighbor m1 : n1) { if (m1.index == m2.index) { recall[i]++; break; } } } } System.out.format("q1 of recall is %d%n", MathEx.q1(recall)); System.out.format("median of recall is %d%n", MathEx.median(recall)); System.out.format("q3 of recall is %d%n", MathEx.q3(recall)); }
@Override public void range(double[] q, double radius, List<Neighbor<double[], E>> neighbors) { if (model == null) super.range(q,radius, neighbors); else range(q, radius, neighbors, 0.95, 100); }
MPLSH extends LSH<E> { @Override public void range(double[] q, double radius, List<Neighbor<double[], E>> neighbors) { if (model == null) super.range(q,radius, neighbors); else range(q, radius, neighbors, 0.95, 100); } }
MPLSH extends LSH<E> { @Override public void range(double[] q, double radius, List<Neighbor<double[], E>> neighbors) { if (model == null) super.range(q,radius, neighbors); else range(q, radius, neighbors, 0.95, 100); } MPLSH(int d, int L, int k, double w);  MPLSH(int d, int L, int k, double w, int H); }
MPLSH extends LSH<E> { @Override public void range(double[] q, double radius, List<Neighbor<double[], E>> neighbors) { if (model == null) super.range(q,radius, neighbors); else range(q, radius, neighbors, 0.95, 100); } MPLSH(int d, int L, int k, double w);  MPLSH(int d, int L, int k, double w, int H); @Override String toString(); void fit(RNNSearch<double[], double[]> range, double[][] samples, double radius); void fit(RNNSearch<double[], double[]> range, double[][] samples, double radius, int Nz); void fit(RNNSearch<double[], double[]> range, double[][] samples, double radius, int Nz, double sigma); @Override Neighbor<double[], E> nearest(double[] q); Neighbor<double[], E> nearest(double[] q, double recall, int T); @Override Neighbor<double[], E>[] knn(double[] q, int k); @SuppressWarnings("unchecked") Neighbor<double[], E>[] knn(double[] q, int k, double recall, int T); @Override void range(double[] q, double radius, List<Neighbor<double[], E>> neighbors); void range(double[] q, double radius, List<Neighbor<double[], E>> neighbors, double recall, int T); }
MPLSH extends LSH<E> { @Override public void range(double[] q, double radius, List<Neighbor<double[], E>> neighbors) { if (model == null) super.range(q,radius, neighbors); else range(q, radius, neighbors, 0.95, 100); } MPLSH(int d, int L, int k, double w);  MPLSH(int d, int L, int k, double w, int H); @Override String toString(); void fit(RNNSearch<double[], double[]> range, double[][] samples, double radius); void fit(RNNSearch<double[], double[]> range, double[][] samples, double radius, int Nz); void fit(RNNSearch<double[], double[]> range, double[][] samples, double radius, int Nz, double sigma); @Override Neighbor<double[], E> nearest(double[] q); Neighbor<double[], E> nearest(double[] q, double recall, int T); @Override Neighbor<double[], E>[] knn(double[] q, int k); @SuppressWarnings("unchecked") Neighbor<double[], E>[] knn(double[] q, int k, double recall, int T); @Override void range(double[] q, double radius, List<Neighbor<double[], E>> neighbors); void range(double[] q, double radius, List<Neighbor<double[], E>> neighbors, double recall, int T);  }