Package org.apache.mahout.math.random

Examples of org.apache.mahout.math.random.Normal


public class LocalitySensitiveHashSearchTest {

  @Test
  public void testNormal() {
    Matrix testData = new DenseMatrix(100000, 10);
    final Normal gen = new Normal();
    testData.assign(gen);

    final EuclideanDistanceMeasure distance = new EuclideanDistanceMeasure();
    BruteSearch ref = new BruteSearch(distance);
    ref.addAllMatrixSlicesAsWeightedVectors(testData);
View Full Code Here


    return t1;
  }

  @Test
  public void testDotCorrelation() {
    final Normal gen = new Normal();

    Matrix projection = new DenseMatrix(64, 10);
    projection.assign(gen);

    Vector query = new DenseVector(10);
View Full Code Here

    int numDataVectors = 1000000;
    int numQueries = 100;
    int depth = 2000;

    Matrix data = new DenseMatrix(numDataVectors, dimension);
    data.assign(new Normal());

    Matrix queries = new DenseMatrix(numQueries, dimension);
    queries.assign(new Normal());

    Vector queryNorms = queries.aggregateRows(new VectorFunction() {
      @Override
      public double apply(Vector f) {
        return f.getLengthSquared();
View Full Code Here

public class LocalitySensitiveHashSearchTest {

  @Test
  public void testNormal() {
    Matrix testData = new DenseMatrix(100000, 10);
    final Normal gen = new Normal();
    testData.assign(gen);

    final EuclideanDistanceMeasure distance = new EuclideanDistanceMeasure();
    BruteSearch ref = new BruteSearch(distance);
    ref.addAllMatrixSlicesAsWeightedVectors(testData);
View Full Code Here

    return t1;
  }

  @Test
  public void testDotCorrelation() {
    final Normal gen = new Normal();

    Matrix projection = new DenseMatrix(64, 10);
    projection.assign(gen);

    Vector query = new DenseVector(10);
View Full Code Here

TOP

Related Classes of org.apache.mahout.math.random.Normal

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.