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
Fields Modifier and Type Field Description protected static int
DEFAULT_K
The default desired number of base vectorsprotected int
k
The desired number of base vectors-
Fields inherited from class org.carrot2.attrs.AttrComposite
attributes
-
-
Constructor Summary
Constructors Constructor Description PartialSingularValueDecompositionFactory()
Creates the factory that creates factorizations that compute the maximum number of base vectors.
-
Method Summary
All Methods Instance Methods Concrete Methods 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 .-
Methods inherited from class org.carrot2.attrs.AttrComposite
accept
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.carrot2.attrs.AcceptingVisitor
accept
-
-
-
-
Field Detail
-
k
protected int k
The desired number of base vectors
-
DEFAULT_K
protected static final int DEFAULT_K
The default desired number of base vectors- See Also:
- Constant Field Values
-
-
Method Detail
-
factorize
public MatrixFactorization factorize(org.carrot2.math.mahout.matrix.DoubleMatrix2D A)
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 .
-
-