public class PartialSingularValueDecomposition extends Object implements IMatrixFactorization
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.mahout.math.matrix.DoubleMatrix2D |
A
Input matrix
|
protected static int |
DEFAULT_K
The default number of desired base vectors
|
protected int |
k
The desired number of base vectors
|
protected org.apache.mahout.math.matrix.DoubleMatrix2D |
U
Base vector result matrix
|
protected org.apache.mahout.math.matrix.DoubleMatrix2D |
V
Coefficient result matrix
|
| Constructor and Description |
|---|
PartialSingularValueDecomposition(org.apache.mahout.math.matrix.DoubleMatrix2D A)
Computes a partial SVD of a matrix.
|
| Modifier and Type | Method and Description |
|---|---|
void |
compute()
Computes the factorization.
|
int |
getK()
Returns the number of base vectors k .
|
double[] |
getSingularValues()
Returns singular values of the matrix.
|
org.apache.mahout.math.matrix.DoubleMatrix2D |
getU()
Returns the U matrix (base vectors matrix).
|
org.apache.mahout.math.matrix.DoubleMatrix2D |
getV()
Returns the V matrix (coefficient matrix)
|
void |
setK(int k)
Sets the number of base vectors k .
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetU, getVprotected int k
protected static final int DEFAULT_K
protected org.apache.mahout.math.matrix.DoubleMatrix2D A
protected org.apache.mahout.math.matrix.DoubleMatrix2D U
protected org.apache.mahout.math.matrix.DoubleMatrix2D V
public PartialSingularValueDecomposition(org.apache.mahout.math.matrix.DoubleMatrix2D A)
compute()method.A - matrix to be factorizedpublic void compute()
public double[] getSingularValues()
public void setK(int k)
k - the number of base vectorspublic int getK()
public org.apache.mahout.math.matrix.DoubleMatrix2D getU()
IMatrixFactorizationgetU in interface IMatrixFactorizationpublic org.apache.mahout.math.matrix.DoubleMatrix2D getV()
IMatrixFactorizationgetV in interface IMatrixFactorization