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.Serializable
An 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[]
alpha
protected double
alphaSum
protected double
beta
protected double
betaSum
protected double[]
cachedCoefficients
protected int
numTopics
protected boolean
printWordProbabilities
protected Randoms
random
protected double
smoothingOnlyMass
protected int[]
tokensPerTopic
protected int
topicBits
protected int
topicMask
protected 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 double
evaluateLeftToRight(InstanceList testing, int numParticles, boolean usingResampling, java.io.PrintStream docProbabilityStream)
int[]
getTokensPerTopic()
int[][]
getTypeTopicCounts()
protected double[]
leftToRight(FeatureSequence tokenSequence, boolean usingResampling)
static MarginalProbEstimator
read(java.io.File f)
void
setPrintWords(boolean shouldPrint)
void
setRandom(Randoms r)
void
setRandomSeed(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
-
-