Examples of VectorFunction


Examples of org.apache.mahout.math.function.VectorFunction

    }
  }

  @Test
  public void testAggregateCols() {
    Vector v = test.aggregateColumns(new VectorFunction() {
      @Override
      public double apply(Vector v) {
        return v.zSum();
      }
    });
View Full Code Here

Examples of org.apache.mahout.math.function.VectorFunction

  }

  @Test
  public void testAggregate() {
    double total = test.aggregate(Functions.PLUS, Functions.IDENTITY);
    assertEquals(test.aggregateRows(new VectorFunction() {
      @Override
      public double apply(Vector v) {
        return v.zSum();
      }
    }).zSum(), total, EPSILON);
View Full Code Here

Examples of org.apache.mahout.math.function.VectorFunction

   * @param mapper   A function to apply to each element.
   * @return The result.
   */
  @Override
  public double aggregate(final DoubleDoubleFunction combiner, final DoubleFunction mapper) {
    return aggregateRows(new VectorFunction() {
      @Override
      public double apply(Vector v) {
        return v.aggregate(combiner, mapper);
      }
    }).aggregate(combiner, Functions.IDENTITY);
View Full Code Here

Examples of org.apache.mahout.math.function.VectorFunction

        final Vector pi = sampleNoLink();
        return pi.maxValueIndex();
    }

    private Vector sampleNoLink() {
        final Vector theta = state.aggregateRows(new VectorFunction() {
            final DoubleFunction inverseLink = new InverseLogisticFunction();

            @Override
            public double apply(Vector f) {
                return inverseLink.apply(rand.nextDouble(f.get(0), f.get(1)));
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.