Package org.carrot2.math.matrix
Class PartialSingularValueDecompositionFactory
java.lang.Object
org.carrot2.attrs.AttrComposite
org.carrot2.math.matrix.PartialSingularValueDecompositionFactory
- All Implemented Interfaces:
AcceptingVisitor
,MatrixFactorizationFactory
public class PartialSingularValueDecompositionFactory extends AttrComposite implements MatrixFactorizationFactory
Performs matrix factorization using the Singular Value Decomposition algorithm.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description PartialSingularValueDecompositionFactory()
Creates the factory that creates factorizations that compute the maximum number of base vectors. -
Method Summary
Modifier and Type Method Description MatrixFactorization
factorize(org.carrot2.math.mahout.matrix.DoubleMatrix2D A)
Factorizes matrixA
.int
getK()
Returns the number of base vectors k .void
setK(int k)
Sets the number of base vectors k .
-
Field Details
-
k
protected int kThe desired number of base vectors -
DEFAULT_K
protected static final int DEFAULT_KThe default desired number of base vectors- See Also:
- Constant Field Values
-
-
Constructor Details
-
PartialSingularValueDecompositionFactory
public PartialSingularValueDecompositionFactory()Creates the factory that creates factorizations that compute the maximum number of base vectors.
-
-
Method Details
-
factorize
Description copied from interface:MatrixFactorizationFactory
Factorizes matrixA
.- Specified by:
factorize
in interfaceMatrixFactorizationFactory
- Parameters:
A
- matrix to be factorized.
-
setK
public void setK(int k)Sets the number of base vectors k .- Parameters:
k
- the number of base vectors
-
getK
public int getK()Returns the number of base vectors k .
-