Package cc.mallet.topics
Class NonNegativeMatrixFactorization
- java.lang.Object
-
- cc.mallet.topics.NonNegativeMatrixFactorization
-
public class NonNegativeMatrixFactorization extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String[]
BARS
-
Constructor Summary
Constructors Constructor Description NonNegativeMatrixFactorization(InstanceList instances, int numFactors, boolean idfWeighting)
NonNegativeMatrixFactorization(InstanceList instances, int numFactors, boolean idfWeighting, Randoms random)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
calculateIDFWeights()
static java.lang.String
getBar(double x, double min, double max)
static java.lang.String
getBars(double[] sequence)
static java.lang.String
getBars(double[] sequence, double min, double max)
double
getDivergence()
void
initialize(int clusterSize)
static void
main(java.lang.String[] args)
void
printFactorFeatures(int limit)
void
updateWeights()
void
writeFeatureFactors(java.io.PrintWriter out)
void
writeInstanceFactors(java.io.PrintWriter out)
-
-
-
Constructor Detail
-
NonNegativeMatrixFactorization
public NonNegativeMatrixFactorization(InstanceList instances, int numFactors, boolean idfWeighting)
-
NonNegativeMatrixFactorization
public NonNegativeMatrixFactorization(InstanceList instances, int numFactors, boolean idfWeighting, Randoms random)
-
-
Method Detail
-
calculateIDFWeights
public void calculateIDFWeights()
-
initialize
public void initialize(int clusterSize)
-
getBar
public static java.lang.String getBar(double x, double min, double max)
-
getBars
public static java.lang.String getBars(double[] sequence, double min, double max)
-
getBars
public static java.lang.String getBars(double[] sequence)
-
getDivergence
public double getDivergence()
-
updateWeights
public void updateWeights()
-
printFactorFeatures
public void printFactorFeatures(int limit)
-
writeFeatureFactors
public void writeFeatureFactors(java.io.PrintWriter out) throws java.io.IOException
- Throws:
java.io.IOException
-
writeInstanceFactors
public void writeInstanceFactors(java.io.PrintWriter out) throws java.io.IOException
- Throws:
java.io.IOException
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-