Examples of RandomAccessSparseVector


Examples of org.apache.mahout.math.RandomAccessSparseVector

    @Override
    public void reduce(IntWritable outRow,
                       Iterator<DistributedRowMatrix.MatrixEntryWritable> it,
                       OutputCollector<IntWritable, VectorWritable> out,
                       Reporter reporter) throws IOException {
      RandomAccessSparseVector tmp = new RandomAccessSparseVector(newNumCols, 100);
      while (it.hasNext()) {
        DistributedRowMatrix.MatrixEntryWritable e = it.next();
        tmp.setQuick(e.getCol(), e.getVal());
      }
      SequentialAccessSparseVector outVector = new SequentialAccessSparseVector(tmp);
      out.collect(outRow, new VectorWritable(outVector));
    }
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.