Package org.carrot2.math.matrix
Class IterativeMatrixFactorizationFactory
- java.lang.Object
-
- org.carrot2.attrs.AttrComposite
-
- org.carrot2.math.matrix.IterativeMatrixFactorizationFactory
-
- All Implemented Interfaces:
AcceptingVisitor
,MatrixFactorizationFactory
- Direct Known Subclasses:
KMeansMatrixFactorizationFactory
,LocalNonnegativeMatrixFactorizationFactory
,NonnegativeMatrixFactorizationEDFactory
,NonnegativeMatrixFactorizationKLFactory
public abstract class IterativeMatrixFactorizationFactory extends AttrComposite implements MatrixFactorizationFactory
A factory forMatrixFactorization
s.
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
DEFAULT_K
The default number of base vectorsprotected static int
DEFAULT_MAX_ITERATIONS
The default number of maximum iterationsprotected static boolean
DEFAULT_ORDERED
protected static SeedingStrategyFactory
DEFAULT_SEEDING_FACTORY
Default matrix seeding strategy factoryprotected static double
DEFAULT_STOP_THRESHOLD
The default stop thresholdAttrEnum<FactorizationQuality>
factorizationQuality
Factorization quality.protected int
k
The number of base vectorsprotected int
maxIterations
The maximum number of iterations the algorithm is allowed to completeprotected boolean
ordered
Order base vectors according to their 'activity'protected SeedingStrategyFactory
seedingFactory
Matrix seeding strategy factoryprotected double
stopThreshold
The algorithm's stop threshold-
Fields inherited from class org.carrot2.attrs.AttrComposite
attributes
-
-
Constructor Summary
Constructors Constructor Description IterativeMatrixFactorizationFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SeedingStrategy
createSeedingStrategy()
void
estimateIterationsNumber(int dimensions, org.carrot2.math.mahout.matrix.DoubleMatrix2D termDocumentMatrix)
int
getK()
Returns the number of base vectors k .int
getMaxIterations()
Returns the maximum number of iterations used by this factory.SeedingStrategyFactory
getSeedingFactory()
Returns theSeedingStrategyFactory
used by this factory.double
getStopThreshold()
Returns the stop threshold used by this factory.boolean
isOrdered()
Returnstrue
when the factorization is set to generate an ordered basis.void
setK(int k)
Sets the number of base vectors k .void
setMaxIterations(int maxIterations)
Sets the maximum number of iterations to be used by this factory.void
setOrdered(boolean ordered)
Set totrue
to generate an ordered basis.void
setSeedingFactory(SeedingStrategyFactory seedingFactory)
Sets theSeedingStrategyFactory
to be used by this factory.void
setStopThreshold(double stopThreshold)
Sets the stop threshold to be used by this factory.-
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
-
Methods inherited from interface org.carrot2.math.matrix.MatrixFactorizationFactory
factorize
-
-
-
-
Field Detail
-
factorizationQuality
public final AttrEnum<FactorizationQuality> factorizationQuality
Factorization quality. The number of iterations of matrix factorization to perform. The higher the required quality, the more time-consuming clustering.
-
k
protected int k
The number of base vectors
-
DEFAULT_K
protected static final int DEFAULT_K
The default number of base vectors- See Also:
- Constant Field Values
-
maxIterations
protected int maxIterations
The maximum number of iterations the algorithm is allowed to complete
-
DEFAULT_MAX_ITERATIONS
protected static final int DEFAULT_MAX_ITERATIONS
The default number of maximum iterations- See Also:
- Constant Field Values
-
stopThreshold
protected double stopThreshold
The algorithm's stop threshold
-
DEFAULT_STOP_THRESHOLD
protected static final double DEFAULT_STOP_THRESHOLD
The default stop threshold- See Also:
- Constant Field Values
-
seedingFactory
protected SeedingStrategyFactory seedingFactory
Matrix seeding strategy factory
-
DEFAULT_SEEDING_FACTORY
protected static final SeedingStrategyFactory DEFAULT_SEEDING_FACTORY
Default matrix seeding strategy factory
-
ordered
protected boolean ordered
Order base vectors according to their 'activity'
-
DEFAULT_ORDERED
protected static final boolean DEFAULT_ORDERED
- See Also:
- Constant Field Values
-
-
Method Detail
-
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 .
-
createSeedingStrategy
protected SeedingStrategy createSeedingStrategy()
-
getMaxIterations
public int getMaxIterations()
Returns the maximum number of iterations used by this factory.
-
setMaxIterations
public void setMaxIterations(int maxIterations)
Sets the maximum number of iterations to be used by this factory.
-
getStopThreshold
public double getStopThreshold()
Returns the stop threshold used by this factory.
-
setStopThreshold
public void setStopThreshold(double stopThreshold)
Sets the stop threshold to be used by this factory.
-
getSeedingFactory
public SeedingStrategyFactory getSeedingFactory()
Returns theSeedingStrategyFactory
used by this factory.
-
setSeedingFactory
public void setSeedingFactory(SeedingStrategyFactory seedingFactory)
Sets theSeedingStrategyFactory
to be used by this factory.
-
isOrdered
public boolean isOrdered()
Returnstrue
when the factorization is set to generate an ordered basis.
-
setOrdered
public void setOrdered(boolean ordered)
Set totrue
to generate an ordered basis.
-
estimateIterationsNumber
public void estimateIterationsNumber(int dimensions, org.carrot2.math.mahout.matrix.DoubleMatrix2D termDocumentMatrix)
-
-