|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cc.mallet.topics.HierarchicalLDA
public class HierarchicalLDA
Constructor Summary | |
---|---|
HierarchicalLDA()
|
Method Summary | |
---|---|
void |
calculateNCRP(gnu.trove.TObjectDoubleHashMap<cc.mallet.topics.HierarchicalLDA.NCRPNode> nodeWeights,
cc.mallet.topics.HierarchicalLDA.NCRPNode node,
double weight)
|
void |
calculateWordLikelihood(gnu.trove.TObjectDoubleHashMap<cc.mallet.topics.HierarchicalLDA.NCRPNode> nodeWeights,
cc.mallet.topics.HierarchicalLDA.NCRPNode node,
double weight,
gnu.trove.TIntIntHashMap[] typeCounts,
double[] newTopicWeights,
int level,
int iteration)
|
double |
empiricalLikelihood(int numSamples,
InstanceList testing)
For use with empirical likelihood evaluation: sample a path through the tree, then sample a multinomial over topics in that path, then return a weighted sum of words. |
void |
estimate(int numIterations)
|
void |
initialize(InstanceList instances,
InstanceList testing,
int numLevels,
Randoms random)
|
static void |
main(java.lang.String[] args)
This method is primarily for testing purposes. |
void |
printNode(cc.mallet.topics.HierarchicalLDA.NCRPNode node,
int indent)
|
void |
printNodes()
|
void |
printState()
Writes the current sampling state to the file specified in stateFile . |
void |
printState(java.io.PrintWriter out)
Write a text file describing the current sampling state. |
void |
propagateTopicWeight(gnu.trove.TObjectDoubleHashMap<cc.mallet.topics.HierarchicalLDA.NCRPNode> nodeWeights,
cc.mallet.topics.HierarchicalLDA.NCRPNode node,
double weight)
Propagate a topic weight to a node and all its children. |
void |
samplePath(int doc,
int iteration)
|
void |
sampleTopics(int doc)
|
void |
setAlpha(double alpha)
|
void |
setEta(double eta)
|
void |
setGamma(double gamma)
|
void |
setProgressDisplay(boolean showProgress)
This parameter determines whether the sampler outputs shows progress by outputting a character after every iteration. |
void |
setStateFile(java.lang.String stateFile)
|
void |
setTopicDisplay(int interval,
int words)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HierarchicalLDA()
Method Detail |
---|
public void setAlpha(double alpha)
public void setGamma(double gamma)
public void setEta(double eta)
public void setStateFile(java.lang.String stateFile)
public void setTopicDisplay(int interval, int words)
public void setProgressDisplay(boolean showProgress)
public void initialize(InstanceList instances, InstanceList testing, int numLevels, Randoms random)
public void estimate(int numIterations)
public void samplePath(int doc, int iteration)
public void calculateNCRP(gnu.trove.TObjectDoubleHashMap<cc.mallet.topics.HierarchicalLDA.NCRPNode> nodeWeights, cc.mallet.topics.HierarchicalLDA.NCRPNode node, double weight)
public void calculateWordLikelihood(gnu.trove.TObjectDoubleHashMap<cc.mallet.topics.HierarchicalLDA.NCRPNode> nodeWeights, cc.mallet.topics.HierarchicalLDA.NCRPNode node, double weight, gnu.trove.TIntIntHashMap[] typeCounts, double[] newTopicWeights, int level, int iteration)
public void propagateTopicWeight(gnu.trove.TObjectDoubleHashMap<cc.mallet.topics.HierarchicalLDA.NCRPNode> nodeWeights, cc.mallet.topics.HierarchicalLDA.NCRPNode node, double weight)
public void sampleTopics(int doc)
public void printState() throws java.io.IOException, java.io.FileNotFoundException
stateFile
.
java.io.IOException
java.io.FileNotFoundException
public void printState(java.io.PrintWriter out) throws java.io.IOException
java.io.IOException
public void printNodes()
public void printNode(cc.mallet.topics.HierarchicalLDA.NCRPNode node, int indent)
public double empiricalLikelihood(int numSamples, InstanceList testing)
public static void main(java.lang.String[] args)
HierarchicalLDATUI
class has a more flexible interface for command-line use.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |