Package cc.mallet.topics
Class LDAStream
- java.lang.Object
-
- cc.mallet.topics.LDAHyper
-
- cc.mallet.topics.LDAStream
-
- All Implemented Interfaces:
java.io.Serializable
public class LDAStream extends LDAHyper
- Author:
- Limin Yao, David Mimno
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class cc.mallet.topics.LDAHyper
LDAHyper.Topication
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.ArrayList<LDAHyper.Topication>test-
Fields inherited from class cc.mallet.topics.LDAHyper
alpha, alphabet, alphaSum, beta, betaSum, burninPeriod, cachedCoefficients, data, DEFAULT_BETA, docLengthCounts, formatter, iterationsSoFar, numIterations, numTopics, numTypes, oneDocTopicCounts, optimizeInterval, outputModelFilename, outputModelInterval, printLogLikelihood, random, saveSampleInterval, saveStateInterval, showTopicsInterval, smoothingOnlyMass, stateFilename, testing, tokensPerTopic, topicAlphabet, topicDocCounts, typeTopicCounts, wordsPerTopic
-
-
Constructor Summary
Constructors Constructor Description LDAStream(int numberOfTopics)LDAStream(int numberOfTopics, double alphaSum, double beta)LDAStream(int numberOfTopics, double alphaSum, double beta, Randoms random)LDAStream(LabelAlphabet topicAlphabet, double alphaSum, double beta, Randoms random)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidestimateAll(int iteration)java.util.ArrayList<LDAHyper.Topication>getTest()voidinference(int maxIteration)voidinferenceAll(int maxIteration)voidinferenceOneByOne(int maxIteration)voidinferenceWithTheta(int maxIteration, InstanceList theta)voidprintDocumentTopics(java.util.ArrayList<LDAHyper.Topication> dataset, java.io.File f)voidprintDocumentTopics(java.util.ArrayList<LDAHyper.Topication> dataset, java.io.PrintWriter pw)voidprintDocumentTopics(java.util.ArrayList<LDAHyper.Topication> dataset, java.io.PrintWriter pw, double threshold, int max)voidprintPhi(java.io.File f, double threshold)voidprintState(java.util.ArrayList<LDAHyper.Topication> dataset, java.io.File f)voidprintState(java.util.ArrayList<LDAHyper.Topication> dataset, java.io.PrintStream out)voidprintTheta(java.util.ArrayList<LDAHyper.Topication> dataset, java.io.File f, double threshold, int max)-
Methods inherited from class cc.mallet.topics.LDAHyper
addInstances, addInstances, empiricalLikelihood, estimate, estimate, getAlphabet, getCountFeatureTopic, getCountTokensPerTopic, getData, getNumTopics, getSortedTopicWords, getTopicAlphabet, initializeHistogramsAndCachedValues, instanceLength, main, modelLogLikelihood, printDocumentTopics, printDocumentTopics, printDocumentTopics, printState, printState, printTopWords, printTopWords, read, sampleTopicsForOneDoc, setBurninPeriod, setModelOutput, setNumIterations, setOptimizeInterval, setRandomSeed, setSaveState, setTestingInstances, setTopicDisplay, topicLabelMutualInformation, topicXMLReport, topicXMLReportPhrases, write
-
-
-
-
Field Detail
-
test
protected java.util.ArrayList<LDAHyper.Topication> test
-
-
Constructor Detail
-
LDAStream
public LDAStream(int numberOfTopics)
- Parameters:
numberOfTopics-
-
LDAStream
public LDAStream(int numberOfTopics, double alphaSum, double beta)- Parameters:
numberOfTopics-alphaSum-beta-
-
LDAStream
public LDAStream(int numberOfTopics, double alphaSum, double beta, Randoms random)- Parameters:
numberOfTopics-alphaSum-beta-random-
-
LDAStream
public LDAStream(LabelAlphabet topicAlphabet, double alphaSum, double beta, Randoms random)
- Parameters:
topicAlphabet-alphaSum-beta-random-
-
-
Method Detail
-
getTest
public java.util.ArrayList<LDAHyper.Topication> getTest()
-
inferenceAll
public void inferenceAll(int maxIteration)
-
estimateAll
public void estimateAll(int iteration) throws java.io.IOException- Throws:
java.io.IOException
-
inference
public void inference(int maxIteration)
- Parameters:
maxIteration-
-
inferenceOneByOne
public void inferenceOneByOne(int maxIteration)
-
inferenceWithTheta
public void inferenceWithTheta(int maxIteration, InstanceList theta)
-
printTheta
public void printTheta(java.util.ArrayList<LDAHyper.Topication> dataset, java.io.File f, double threshold, int max) throws java.io.IOException
- Throws:
java.io.IOException
-
printPhi
public void printPhi(java.io.File f, double threshold) throws java.io.IOException- Throws:
java.io.IOException
-
printDocumentTopics
public void printDocumentTopics(java.util.ArrayList<LDAHyper.Topication> dataset, java.io.File f) throws java.io.IOException
- Throws:
java.io.IOException
-
printDocumentTopics
public void printDocumentTopics(java.util.ArrayList<LDAHyper.Topication> dataset, java.io.PrintWriter pw)
-
printDocumentTopics
public void printDocumentTopics(java.util.ArrayList<LDAHyper.Topication> dataset, java.io.PrintWriter pw, double threshold, int max)
- Parameters:
pw- A print writerthreshold- Only print topics with proportion greater than this numbermax- Print no more than this many topics
-
printState
public void printState(java.util.ArrayList<LDAHyper.Topication> dataset, java.io.File f) throws java.io.IOException
- Throws:
java.io.IOException
-
printState
public void printState(java.util.ArrayList<LDAHyper.Topication> dataset, java.io.PrintStream out)
-
-