Package org.apache.mahout.math

Examples of org.apache.mahout.math.DenseMatrix.assignRow()


      for (int col = 0; col < numCols; col++) {
        double val = r.nextGaussian();
        v.set(col, val);
      }
      v.assign(Functions.MULT, 1/((row + 1) * v.norm(2)));
      matrix.assignRow(row, v);
    }
    if (symmetric) {
      return matrix.times(matrix.transpose());
    }
    return matrix;
View Full Code Here


    Configuration conf = new Configuration();

    int i = 0;
    for (VectorWritable value : new SequenceFileValueIterable<VectorWritable>(rawEigenvectors, conf)) {
      Vector v = value.get();
      eigenVectors.assignRow(i, v);
      i++;
    }
    assertEquals("number of eigenvectors", 7, i);
  }
View Full Code Here

    i = 0;
    for (VectorWritable value : new SequenceFileValueIterable<VectorWritable>(cleanEigenvectors2, conf)) {
      NamedVector v = (NamedVector) value.get();
      log.info(v.getName());
      eigenVectors2.assignRow(i, v);
      newEigenValues.add(EigenVector.getEigenValue(v.getName()));
      i++;
    }

    Collection<Integer> oldEigensFound = Lists.newArrayList();
View Full Code Here

   
    Matrix samples = new DenseMatrix( rows, input.numCols() );
   
    for (int x = 0; x < rows; x++ ) {
     
      samples.assignRow(x, input.viewRow(x) );
     
    }
   
   
    return samples;
View Full Code Here

    for (int i = 0; i < data.size(); i++) {
     
      //in.putRow(i,data.get(i).getFirst());
      inputData.assignRow( i, data.get(i).getFirst().viewRow(0) );
      //out.putRow(i,data.get(i).getSecond());
      outputLabels.assignRow( i, data.get(i).getSecond().viewRow(0) );

    }
   
    return new DataSet( inputData, outputLabels );
   
View Full Code Here

        }
        //examples.putRow(i,getFirst().getRow(i));
        examples.assignRow( i, getFirst().viewRow(i) );
        //outcomes.putRow(i,getSecond().getRow(i));
        outcomes.assignRow( i, getSecond().viewRow(i) );

      }
      return new DataSet(examples,outcomes);
    }
  }
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.