Package cc.mallet.topics
Class MarginalProbEstimator
- java.lang.Object
-
- cc.mallet.topics.MarginalProbEstimator
-
- All Implemented Interfaces:
java.io.Serializable
public class MarginalProbEstimator extends java.lang.Object implements java.io.SerializableAn implementation of topic model marginal probability estimators presented in Wallach et al., "Evaluation Methods for Topic Models", ICML (2009)- Author:
- David Mimno
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected double[]alphaprotected doublealphaSumprotected doublebetaprotected doublebetaSumprotected double[]cachedCoefficientsprotected intnumTopicsprotected booleanprintWordProbabilitiesprotected Randomsrandomprotected doublesmoothingOnlyMassprotected int[]tokensPerTopicprotected inttopicBitsprotected inttopicMaskprotected int[][]typeTopicCounts
-
Constructor Summary
Constructors Constructor Description MarginalProbEstimator(int numTopics, double[] alpha, double alphaSum, double beta, int[][] typeTopicCounts, int[] tokensPerTopic)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description doubleevaluateLeftToRight(InstanceList testing, int numParticles, boolean usingResampling, java.io.PrintStream docProbabilityStream)int[]getTokensPerTopic()int[][]getTypeTopicCounts()protected double[]leftToRight(FeatureSequence tokenSequence, boolean usingResampling)static MarginalProbEstimatorread(java.io.File f)voidsetPrintWords(boolean shouldPrint)voidsetRandom(Randoms r)voidsetRandomSeed(int seed)
-
-
-
Field Detail
-
numTopics
protected int numTopics
-
topicMask
protected int topicMask
-
topicBits
protected int topicBits
-
alpha
protected double[] alpha
-
alphaSum
protected double alphaSum
-
beta
protected double beta
-
betaSum
protected double betaSum
-
smoothingOnlyMass
protected double smoothingOnlyMass
-
cachedCoefficients
protected double[] cachedCoefficients
-
typeTopicCounts
protected int[][] typeTopicCounts
-
tokensPerTopic
protected int[] tokensPerTopic
-
random
protected Randoms random
-
printWordProbabilities
protected boolean printWordProbabilities
-
-
Method Detail
-
setRandomSeed
public void setRandomSeed(int seed)
-
setRandom
public void setRandom(Randoms r)
-
getTokensPerTopic
public int[] getTokensPerTopic()
-
getTypeTopicCounts
public int[][] getTypeTopicCounts()
-
setPrintWords
public void setPrintWords(boolean shouldPrint)
-
evaluateLeftToRight
public double evaluateLeftToRight(InstanceList testing, int numParticles, boolean usingResampling, java.io.PrintStream docProbabilityStream)
-
leftToRight
protected double[] leftToRight(FeatureSequence tokenSequence, boolean usingResampling)
-
read
public static MarginalProbEstimator read(java.io.File f) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-