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 for
MatrixFactorizations.-
Field Summary
Fields Modifier and Type Field Description protected static intDEFAULT_KThe default number of base vectorsprotected static intDEFAULT_MAX_ITERATIONSThe default number of maximum iterationsprotected static booleanDEFAULT_ORDEREDprotected static SeedingStrategyFactoryDEFAULT_SEEDING_FACTORYDefault matrix seeding strategy factoryprotected static doubleDEFAULT_STOP_THRESHOLDThe default stop thresholdAttrEnum<FactorizationQuality>factorizationQualityFactorization quality.protected intkThe number of base vectorsprotected intmaxIterationsThe maximum number of iterations the algorithm is allowed to completeprotected booleanorderedOrder base vectors according to their 'activity'protected SeedingStrategyFactoryseedingFactoryMatrix seeding strategy factoryprotected doublestopThresholdThe algorithm's stop threshold -
Constructor Summary
Constructors Constructor Description IterativeMatrixFactorizationFactory() -
Method Summary
Modifier and Type Method Description protected SeedingStrategycreateSeedingStrategy()voidestimateIterationsNumber(int dimensions, org.carrot2.math.mahout.matrix.DoubleMatrix2D termDocumentMatrix)intgetK()Returns the number of base vectors k .intgetMaxIterations()Returns the maximum number of iterations used by this factory.SeedingStrategyFactorygetSeedingFactory()Returns theSeedingStrategyFactoryused by this factory.doublegetStopThreshold()Returns the stop threshold used by this factory.booleanisOrdered()Returnstruewhen the factorization is set to generate an ordered basis.voidsetK(int k)Sets the number of base vectors k .voidsetMaxIterations(int maxIterations)Sets the maximum number of iterations to be used by this factory.voidsetOrdered(boolean ordered)Set totrueto generate an ordered basis.voidsetSeedingFactory(SeedingStrategyFactory seedingFactory)Sets theSeedingStrategyFactoryto be used by this factory.voidsetStopThreshold(double stopThreshold)Sets the stop threshold to be used by this factory.
-
Field Details
-
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 kThe number of base vectors -
DEFAULT_K
protected static final int DEFAULT_KThe default number of base vectors- See Also:
- Constant Field Values
-
maxIterations
protected int maxIterationsThe maximum number of iterations the algorithm is allowed to complete -
DEFAULT_MAX_ITERATIONS
protected static final int DEFAULT_MAX_ITERATIONSThe default number of maximum iterations- See Also:
- Constant Field Values
-
stopThreshold
protected double stopThresholdThe algorithm's stop threshold -
DEFAULT_STOP_THRESHOLD
protected static final double DEFAULT_STOP_THRESHOLDThe default stop threshold- See Also:
- Constant Field Values
-
seedingFactory
Matrix seeding strategy factory -
DEFAULT_SEEDING_FACTORY
Default matrix seeding strategy factory -
ordered
protected boolean orderedOrder base vectors according to their 'activity' -
DEFAULT_ORDERED
protected static final boolean DEFAULT_ORDERED- See Also:
- Constant Field Values
-
-
Constructor Details
-
IterativeMatrixFactorizationFactory
public IterativeMatrixFactorizationFactory()
-
-
Method Details
-
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
-
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
Returns theSeedingStrategyFactoryused by this factory. -
setSeedingFactory
Sets theSeedingStrategyFactoryto be used by this factory. -
isOrdered
public boolean isOrdered()Returnstruewhen the factorization is set to generate an ordered basis. -
setOrdered
public void setOrdered(boolean ordered)Set totrueto generate an ordered basis. -
estimateIterationsNumber
public void estimateIterationsNumber(int dimensions, org.carrot2.math.mahout.matrix.DoubleMatrix2D termDocumentMatrix)
-