Package org.apache.mahout.knn.search

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

TOP

Related Classes of org.apache.mahout.knn.search.FastProjectionSearch

Copyright © 2018 www.massapicom. 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.