Examples of FastProjectionSearch


Examples of org.apache.mahout.knn.search.FastProjectionSearch

      radius.add(furthest);
    }
    log.warn("Reference data stored");
    log.warn("Starting add with speedup of {}", numDataVectors / (dimension * 2.0 * depth * 4.0));

    Searcher sut = new FastProjectionSearch(new SquaredEuclideanDistanceMeasure(), dimension * 2, depth * 4);
    sut.addAllMatrixSlicesAsWeightedVectors(data);
    log.warn("Added data with speedup of {}", numDataVectors / (dimension * 2.0 * depth * 4.0));

    long t0 = System.nanoTime();
    for (MatrixSlice query : queries) {
      List<WeightedThing<Vector>> r = sut.search(query.vector(), depth);
      Set<Integer> x = Sets.newHashSet();
      for (WeightedThing<Vector> vector : r) {
        x.add(((WeightedVector)vector.getValue()).getIndex());
      }
      double overlap = Sets.intersection(reference.get(query.index()), x).size() / (double) depth;
View Full Code Here

Examples of org.apache.mahout.math.neighborhood.FastProjectionSearch

  @Parameters
  public static List<Object[]> generateData() {
    return Arrays.asList(new Object[][] {
        {new ProjectionSearch(new SquaredEuclideanDistanceMeasure(), NUM_PROJECTIONS, SEARCH_SIZE), true},
        {new FastProjectionSearch(new SquaredEuclideanDistanceMeasure(), NUM_PROJECTIONS, SEARCH_SIZE),
            true},
        {new ProjectionSearch(new SquaredEuclideanDistanceMeasure(), NUM_PROJECTIONS, SEARCH_SIZE), false},
        {new FastProjectionSearch(new SquaredEuclideanDistanceMeasure(), NUM_PROJECTIONS, SEARCH_SIZE),
            false},
    });
  }
View Full Code Here

Examples of org.apache.mahout.math.neighborhood.FastProjectionSearch

  @Parameters
  public static List<Object[]> generateData() {
    return Arrays.asList(new Object[][] {
        {new ProjectionSearch(new SquaredEuclideanDistanceMeasure(), NUM_PROJECTIONS, SEARCH_SIZE), true},
        {new FastProjectionSearch(new SquaredEuclideanDistanceMeasure(), NUM_PROJECTIONS, SEARCH_SIZE),
            true},
        {new ProjectionSearch(new SquaredEuclideanDistanceMeasure(), NUM_PROJECTIONS, SEARCH_SIZE), false},
        {new FastProjectionSearch(new SquaredEuclideanDistanceMeasure(), NUM_PROJECTIONS, SEARCH_SIZE),
            false},
    });
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.