Examples of viewColumn()


Examples of org.apache.mahout.math.Matrix.viewColumn()

    values[1][1] = 0.0;
    values[2][2] = 0.0;

    Matrix dataset = new DenseMatrix(values);
    trainer.train(labelset, dataset);
    assertTrue(trainer.getModel().classify(dataset.viewColumn(3)));
    assertFalse(trainer.getModel().classify(dataset.viewColumn(0)));
  }

}
View Full Code Here

Examples of org.apache.mahout.math.Matrix.viewColumn()

    values[2][2] = 0.0;

    Matrix dataset = new DenseMatrix(values);
    trainer.train(labelset, dataset);
    assertTrue(trainer.getModel().classify(dataset.viewColumn(3)));
    assertFalse(trainer.getModel().classify(dataset.viewColumn(0)));
  }

}
View Full Code Here

Examples of org.apache.mahout.math.Matrix.viewColumn()

    values[1][1] = 0.0;
    values[2][2] = 0.0;

    Matrix dataset = new DenseMatrix(values);
    this.trainer.train(labelset, dataset);
    assertFalse(this.trainer.getModel().classify(dataset.viewColumn(3)));
    assertTrue(this.trainer.getModel().classify(dataset.viewColumn(0)));
  }

}
View Full Code Here

Examples of org.apache.mahout.math.Matrix.viewColumn()

    values[2][2] = 0.0;

    Matrix dataset = new DenseMatrix(values);
    this.trainer.train(labelset, dataset);
    assertFalse(this.trainer.getModel().classify(dataset.viewColumn(3)));
    assertTrue(this.trainer.getModel().classify(dataset.viewColumn(0)));
  }

}
View Full Code Here

Examples of org.apache.mahout.math.Matrix.viewColumn()

    Matrix u = generateDenseOrthonormalRandom(m, svCnt, rnd);

    // apply singular values
    Matrix mx = m > n ? v : u;
    for (int i = 0; i < svCnt; i++) {
      mx.assignColumn(i, mx.viewColumn(i).times(svalues.getQuick(i)));
    }

    SequenceFile.Writer w =
      SequenceFile.createWriter(dfs,
                                dfs.getConf(),
View Full Code Here

Examples of org.apache.mahout.math.matrix.DoubleMatrix2D.viewColumn()

    for (int c = columnIndexes.length; --c >= 0;) {
      int column = columnIndexes[c];
      if (column < 0 || column >= columns) {
        throw new IndexOutOfBoundsException("Illegal Index");
      }
      sub.viewColumn(c).assign(A.viewColumn(column));
    }
    return sub;
  }

  /**
 
View Full Code Here

Examples of org.apache.mahout.math.matrix.DoubleMatrix2D.viewColumn()

    for (int k = n - 1; k >= 0; k--) {
      DoubleMatrix1D QRcolk = QR.viewColumn(k).viewPart(k, m - k);
      Q.setQuick(k, k, 1);
      for (int j = k; j < n; j++) {
        if (QR.getQuick(k, k) != 0) {
          DoubleMatrix1D Qcolj = Q.viewColumn(j).viewPart(k, m - k);
          double s = QRcolk.zDotProduct(Qcolj);
          s = -s / QR.getQuick(k, k);
          Qcolj.assign(QRcolk, Functions.plusMult(s));
        }
      }
View Full Code Here

Examples of org.apache.mahout.math.matrix.DoubleMatrix2D.viewColumn()

    startTime(TimingSection.FINAL_EIGEN_CREATE);

    for (int i = 0; i < basis.numRows() - 1; i++) {
      Vector realEigen = new DenseVector(corpus.numCols());
      // the eigenvectors live as columns of V, in reverse order.  Weird but true.
      DoubleMatrix1D ejCol = eigenVects.viewColumn(basis.numRows() - i - 1);
      for (int j = 0; j < ejCol.size(); j++) {
        double d = ejCol.getQuick(j);
        realEigen.assign(basis.getRow(j), new PlusMult(d));
      }
      realEigen = realEigen.normalize();
View Full Code Here

Examples of org.apache.mahout.math.matrix.DoubleMatrix2D.viewColumn()

    endTime(TimingSection.TRIDIAG_DECOMP);
    startTime(TimingSection.FINAL_EIGEN_CREATE);
    for (int row = 0; row < i; row++) {
      Vector realEigen = null;
      // the eigenvectors live as columns of V, in reverse order.  Weird but true.
      DoubleMatrix1D ejCol = eigenVects.viewColumn(i - row - 1);
      int size = Math.min(ejCol.size(), state.getBasisSize());
      for (int j = 0; j < size; j++) {
        double d = ejCol.get(j);
        Vector rowJ = state.getBasisVector(j);
        if(realEigen == null) {
View Full Code Here

Examples of org.apache.mahout.math.matrix.DoubleMatrix2D.viewColumn()

    for (int k = n - 1; k >= 0; k--) {
      DoubleMatrix1D QRcolk = QR.viewColumn(k).viewPart(k, m - k);
      Q.setQuick(k, k, 1);
      for (int j = k; j < n; j++) {
        if (QR.getQuick(k, k) != 0) {
          DoubleMatrix1D Qcolj = Q.viewColumn(j).viewPart(k, m - k);
          double s = QRcolk.zDotProduct(Qcolj);
          s = -s / QR.getQuick(k, k);
          Qcolj.assign(QRcolk, Functions.plusMult(s));
        }
      }
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.