Package org.apache.mahout.math

Examples of org.apache.mahout.math.ConstantVector


  private static final int VECTOR_DIMENSION = 250;
  private static final int REFERENCE_SIZE = 10000;
  private static final int QUERY_SIZE = 100;

  public static void main(String[] args) {
    Sampler<Vector> rand = new MultiNormal(new ConstantVector(1, VECTOR_DIMENSION));
    List<WeightedVector> referenceVectors = Lists.newArrayListWithExpectedSize(REFERENCE_SIZE);
    for (int i = 0; i < REFERENCE_SIZE; ++i) {
      referenceVectors.add(new WeightedVector(rand.sample(), 1, i));
    }
    System.out.printf("Generated reference matrix.\n");
View Full Code Here


  private static List<? extends WeightedVector> cubishTestData(double radius) {
    List<WeightedVector> data = Lists.newArrayListWithCapacity(K1 + 5000);
    int row = 0;

    MultiNormal g = new MultiNormal(radius, new ConstantVector(0, 10));
    for (int i = 0; i < K1; i++) {
      data.add(new WeightedVector(g.sample(), 1, row++));
    }

    for (int i = 0; i < 5; i++) {
View Full Code Here

  private static List<? extends WeightedVector> cubishTestData(double radius) {
    List<WeightedVector> data = Lists.newArrayListWithCapacity(K1 + 5000);
    int row = 0;

    MultiNormal g = new MultiNormal(radius, new ConstantVector(0, 10));
    for (int i = 0; i < K1; i++) {
      data.add(new WeightedVector(g.sample(), 1, row++));
    }

    for (int i = 0; i < 5; i++) {
View Full Code Here

TOP

Related Classes of org.apache.mahout.math.ConstantVector

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.