Example usage for org.apache.mahout.math VectorWritable mergeToVector

List of usage examples for org.apache.mahout.math VectorWritable mergeToVector

Introduction

In this page you can find the example usage for org.apache.mahout.math VectorWritable mergeToVector.

Prototype

public static Vector mergeToVector(Iterator<VectorWritable> vectors) 

Source Link

Usage

From source file:org.gpfvic.mahout.cf.taste.hadoop.preparation.ToItemVectorsReducer.java

License:Apache License

@Override
protected void reduce(IntWritable row, Iterable<VectorWritable> vectors, Context ctx)
        throws IOException, InterruptedException {

    merged.setWritesLaxPrecision(true);/*from  w  ww  .jav  a2  s .c o m*/
    merged.set(VectorWritable.mergeToVector(vectors.iterator()));
    ctx.write(row, merged);
}

From source file:org.hf.mls.mahout.cf.taste.hadoop.preparation.ToItemVectorsReducer.java

License:Apache License

@Override
protected void reduce(IntWritable row, Iterable<VectorWritable> vectors, Context ctx)
        throws IOException, InterruptedException {
    merged.setWritesLaxPrecision(true);//from   w ww  .j  av  a2  s. c  om
    merged.set(VectorWritable.mergeToVector(vectors.iterator()));
    ctx.write(row, merged);
}