org.carrot2.matrix.factorization
Class IterativeMatrixFactorizationFactory

java.lang.Object
  extended by org.carrot2.matrix.factorization.IterativeMatrixFactorizationFactory
All Implemented Interfaces:
IMatrixFactorizationFactory
Direct Known Subclasses:
KMeansMatrixFactorizationFactory, LocalNonnegativeMatrixFactorizationFactory, NonnegativeMatrixFactorizationEDFactory, NonnegativeMatrixFactorizationKLFactory

public abstract class IterativeMatrixFactorizationFactory
extends Object
implements IMatrixFactorizationFactory

A factory for IMatrixFactorizations.


Field Summary
protected static int DEFAULT_K
          The default number of base vectors
protected static int DEFAULT_MAX_ITERATIONS
          The default number of maximum iterations
protected static boolean DEFAULT_ORDERED
           
protected static ISeedingStrategyFactory DEFAULT_SEEDING_FACTORY
          Default matrix seeding strategy factory
protected static double DEFAULT_STOP_THRESHOLD
          The default stop threshold
protected  int k
          The number of base vectors
protected  int maxIterations
          The maximum number of iterations the algorithm is allowed to complete
protected  boolean ordered
          Order base vectors according to their 'activity'
protected  ISeedingStrategyFactory seedingFactory
          Matrix seeding strategy factory
protected  double stopThreshold
          The algorithm's stop threshold
 
Constructor Summary
IterativeMatrixFactorizationFactory()
           
 
Method Summary
protected  ISeedingStrategy createSeedingStrategy()
          Returns RandomSeedingStrategy with constant seed.
 int getK()
          Returns the number of base vectors k .
 int getMaxIterations()
          Returns the maximum number of iterations used by this factory.
 ISeedingStrategyFactory getSeedingFactory()
          Returns the ISeedingStrategyFactory used by this factory.
 double getStopThreshold()
          Returns the stop threshold used by this factory.
 boolean isOrdered()
          Returns true 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 to true to generate an ordered basis.
 void setSeedingFactory(ISeedingStrategyFactory seedingFactory)
          Sets the ISeedingStrategyFactory to be used by this factory.
 void setStopThreshold(double stopThreshold)
          Sets the stop threshold to be used by this factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.carrot2.matrix.factorization.IMatrixFactorizationFactory
factorize
 

Field Detail

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 ISeedingStrategyFactory seedingFactory
Matrix seeding strategy factory


DEFAULT_SEEDING_FACTORY

protected static final ISeedingStrategyFactory 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
Constructor Detail

IterativeMatrixFactorizationFactory

public IterativeMatrixFactorizationFactory()
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 ISeedingStrategy createSeedingStrategy()
Returns RandomSeedingStrategy with constant seed.


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 ISeedingStrategyFactory getSeedingFactory()
Returns the ISeedingStrategyFactory used by this factory.


setSeedingFactory

public void setSeedingFactory(ISeedingStrategyFactory seedingFactory)
Sets the ISeedingStrategyFactory to be used by this factory.

Parameters:
seedingFactory -

isOrdered

public boolean isOrdered()
Returns true when the factorization is set to generate an ordered basis.


setOrdered

public void setOrdered(boolean ordered)
Set to true to generate an ordered basis.

Parameters:
ordered -


Copyright (c) Dawid Weiss, Stanislaw Osinski